-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UndoMove does not place pieces back #135
Comments
If starting on white, wouldn't it simply skip whites turn then skip blacks turn? I'm having, I think, similar issues as you. The I'm not 100% sure if this is intended behavior and I'm just missing it or not. |
For now my solution is Board newboard = Board.CreateBoardFromFEN(board.GetFenString());
newboard.TrySkipTurn(); though I'm not sure how compliant that is with the rules. |
Complies fine with the rules IMO, but will be slow, so it's not an ideal fix. Hopefully we'll get a real solution soon. |
Been doing some testing and noticed after a while that the bot was failing to see checkmate, despite having a clear if statement checking for it. After a bit I decied to output the FEN strings, and found this...
There is a white Knight on g5 that can be seen in the original FEN. When it is not taken, e8e7, the UndoMove function works fine. After it is taken, d8g5, the UndoMove function fails to place the Knight back, as the FEN string shows.
After some more testing, I found the culprit to be the
board.TrySkipTurn()
method. If placed twice in a row, effectively doing nothing, the UndoMove function fails to place a piece back,The text was updated successfully, but these errors were encountered: