Skip to content
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

Game ends incorrectly #97

Open
drewhannay opened this issue Sep 6, 2012 · 1 comment
Open

Game ends incorrectly #97

drewhannay opened this issue Sep 6, 2012 · 1 comment

Comments

@drewhannay
Copy link
Owner

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?

@awolfe9
Copy link
Collaborator

awolfe9 commented Oct 9, 2013

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants