douglasbagnall / p4wn

a smallish turn-of-the-century javascript chess engine
http://p4wn.sf.net
113 stars 33 forks source link

(possibly) incorrect computer generated move #16

Closed dusadrian closed 8 years ago

dusadrian commented 9 years ago
  1. Starting FEN: "r2k3B/ppp2p1p/7n/3p4/8/1P3N2/P4qP1/4RRK1 w q - 0 17"
  2. White moves 1. Rxf2
  3. Using the command state.findmove(6), I get the response 1...c5
  4. White moves 2. Bf6+
  5. Using again the command state.findmove(6), I get 2...Rxf6 (????)

At step number 5, the command state.findmove(6) returns [70, 76, 69], and AFAIU 70 should not be a valid "from" square.

douglasbagnall commented 9 years ago

Right. 70 is off the board, but for some reason p4wn thinks there is a black rook there.

It could be an interaction between the deeper search and the castling checks. The position described in the FEN is not actually possible as far as I can tell: it has the black queen-side castling option, but the king is not on his original square (he's on the queen's square).

The same FEN without the castling option seems to work:

r2k3B/ppp2p1p/7n/3p4/8/1P3N2/P4qP1/4RRK1 w - - 0 17
dusadrian commented 9 years ago

Oh, right...! That might be the problem indeed.