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

Bug fix: Bot move freezes player move #84

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

LucaSain
Copy link

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:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@thomas-mauran
Copy link
Owner

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

infernosalex and others added 2 commits November 12, 2024 21:01
* Add reset the game/ go to the menu by pressing a key

* Material difference

---------

Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
Co-authored-by: Thomas Mauran <thomasmauran@yahoo.com>
@thomas-mauran thomas-mauran added the bug Something isn't working label Nov 13, 2024
@LucaSain
Copy link
Author

Hi, sorry for late reply.

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

Try with this bot. It's slower and the issue should visible:
https://github.com/LucaSain/chess-daniel

@thomas-mauran
Copy link
Owner

Hi, sorry for late reply.

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

Try with this bot. It's slower and the issue should visible: https://github.com/LucaSain/chess-daniel

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:
Capture d’écran, le 2024-11-13 à 18 42 14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bot move freezes player move.
3 participants