joeldick / chess_puzzles2

0 stars 0 forks source link

Mates in two - update board after white's first move #2

Closed joeldick closed 2 months ago

joeldick commented 2 months ago

For the mates-in-two (starting from puzzle #307), when white makes their first move and then makes a move for black, the position on the Game Board doesn't reflect the state of the game. So when the user tries to make a move for black again, it considers it an illegal move.

joeldick commented 2 months ago

Solved implicitly when I changed how the board position is being passed to Chessboard. It now uses a gamePosition variable that is being updated in the goToProblem function.