]> git.sesse.net Git - stockfish/commit
FEN parsing: add a second check for correctly setting e.p. square
authorjoergoster <osterj165@googlemail.com>
Wed, 9 Nov 2016 15:42:27 +0000 (16:42 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 10 Nov 2016 10:45:51 +0000 (11:45 +0100)
commitde269ee18e78bc59f30996be71820b7f8af09edc
tree2f680e828d77a206283fc66a94c8916eb55adfca
parentdc4655e1f9b77910afc6521c1b87661389b44e06
FEN parsing: add a second check for correctly setting e.p. square

Currently, we only check if there is a pawn in place
to make the en-passant capture. Now also check that
there is a pawn that could just have advanced two
squares. Also update the corresponding comment.

This makes the parsing of FENs a bit more robust, and
now correctly handles positions like the one reported by Dann Corbit.

position fen rnbqkb1r/ppp3pp/3p1n2/3P4/8/2P5/PP3PPP/RNBQKB1R w KQkq e6
d

 +---+---+---+---+---+---+---+---+
 | r | n | b | q | k | b |   | r |
 +---+---+---+---+---+---+---+---+
 | p | p | p |   |   |   | p | p |
 +---+---+---+---+---+---+---+---+
 |   |   |   | p |   | n |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   | P |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   | P |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 | P | P |   |   |   | P | P | P |
 +---+---+---+---+---+---+---+---+
 | R | N | B | Q | K | B |   | R |
 +---+---+---+---+---+---+---+---+

Fen: rnbqkb1r/ppp3pp/3p1n2/3P4/8/2P5/PP3PPP/RNBQKB1R w KQkq - 0 1

No functional change.
src/position.cpp