You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if you execute the game: 1. F3, E5 2. G4 QH4 # then our program first declares the game a draw (wrong), and then after you click "New Game" or "Save Record", it properly declares Black the winner. I did some preliminary investigating and it looks like the cause is that in Game.playMove(Move move), we call endOfGame() first on the blackRules and then on the whiteRules.
I think a potential fix would be to call black's rules endOfGame() first if it's black's turn and white's rules endOfGame() first if it's white's turn. Then if either of those calls actually end the game, we shouldn't call the second one.
I'm not going to do that quite yet, because I'm just wary of breaking something else. Anyone else have feedback on this solution?
The text was updated successfully, but these errors were encountered:
Just FYI, when running this game on master now, it says what is in check, but doesn't register it as mate. And then you can move the king to F2, then take it with the queen, so I guess it all works out, but we should probably be catching that checkmate sooner, huh?
Currently, if you execute the game: 1. F3, E5 2. G4 QH4 # then our program first declares the game a draw (wrong), and then after you click "New Game" or "Save Record", it properly declares Black the winner. I did some preliminary investigating and it looks like the cause is that in Game.playMove(Move move), we call endOfGame() first on the blackRules and then on the whiteRules.
I think a potential fix would be to call black's rules endOfGame() first if it's black's turn and white's rules endOfGame() first if it's white's turn. Then if either of those calls actually end the game, we shouldn't call the second one.
I'm not going to do that quite yet, because I'm just wary of breaking something else. Anyone else have feedback on this solution?
The text was updated successfully, but these errors were encountered: