-
Notifications
You must be signed in to change notification settings - Fork 30
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
Bug fix: Bot move freezes player move #84
Conversation
Hello @LucaSain thanks for the contribution the code seems good and logical, do you have any steps to reproduce the bug ? I wasn't able to reproduce it on my computer |
* Add reset the game/ go to the menu by pressing a key * Material difference --------- Signed-off-by: Thomas Mauran <[email protected]> Co-authored-by: Thomas Mauran <[email protected]>
Hi, sorry for late reply.
Try with this bot. It's slower and the issue should visible: |
Ah yes I do see it now, I tried to play a game and lost but the game didn't end after reading the code maybe this is an edge case, I was able to get the Black Won text after selecting the black queen in this position: |
Hi @LucaSain wanting to know if you will finish this issue or if I shall do it ? |
Working on it right now. I'll try to finish it by tomorrow. |
This should do, however this still feels like a workaround. Should I create a new method or move the checkmate and draft check from the if clause to the switch_turn method? |
This will do the trick for now, I am working on a refactor so this will probably be part of it. Thanks for your contribution ! 🎉 |
Fix for player move freeze by bot move computation
Description
On each game tick, the bot move state will be checked and the player move will be rendered first.
This solution relies on a variable exposed through the board enum and an if clause in the app loop. This solution is not perfect and maybe a thread-event approach would be better. Any feedback would be extremely helpful.
Fixes #83
Checklist: