lichess-org / dartchess

Dart chess library for native platforms
https://pub.dev/packages/dartchess
GNU General Public License v3.0
33 stars 17 forks source link

Crazyhouse en passant bug with DropMove #23

Open dbergan opened 1 year ago

dbergan commented 1 year ago

_copyWith() carries the epSquare forward to the next move when a DropMove is played, which makes this sequence possible:

  1. d4 e5
  2. Nf3 Qg5
  3. Nxg5 Be7
  4. dxe5 Bd8
  5. Nc3 f5 (creates epSquare at f6)
  6. Q@f7 (copyWith() is given null for epSquare, which then copies the epSquare of f6 forward to Black) 6... gxf6 (captures the Queen on f7!)