Closed Ronnypetson closed 2 years ago
Here is a print up to move 13. Bb1 We can see clearly that c4 is not possible.
Doing
game_str = '1. e4 c5 2. c4 e6 3. Nf3 d5 4. e5 Nc6 5. d4 Nh6 6. Nbd2 Nf5 7. Bd3 Be7 8. O-O O-O 9. b3 Na5 10. Bb2 b6 11. a3 Bb7 12. Qe2 Rc8 13. Bb1 c4 1/2-1/2'
pgn = io.StringIO(game_str)
game = chess.pgn.read_game(pgn)
board = game.board()
for idx, move in enumerate(game.mainline_moves()):
board.push(move)
Yields the final board position
Here is a sequence with the same problem
Thanks for reporting. It "works" because c4
is interpreted as "pawn move to c4", which has a unique matching move dxc4
, so that one is selected. I agree that it should probably be rejected, instead.
Hello,
I was checking some synthetic PGN sequences generated from language models when I found out that
should not be allowed at move 13. ... c4 (I checked by loading the PGN on chess.com), but python-chess allows such move.