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

A Congratulations you won text box? #33

Closed
turkishfilms opened this issue Nov 28, 2024 · 5 comments
Closed

A Congratulations you won text box? #33

turkishfilms opened this issue Nov 28, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@turkishfilms
Copy link

What feature would you like to see in cli-chess?

I won and it was great in Offline mode. But then it still prompted me for a move and the only way to exit was to type quit and then it pronounced the checkmated white side victorious. ;/

@turkishfilms turkishfilms added the enhancement New feature or request label Nov 28, 2024
@trevorbayless
Copy link
Owner

If you checkmate your opponent (offline or online) it should immediately notify you of the checkmate, and end the game. If that didn't happen it sounds like there could be a bug. I'd be interested in seeing the logs if you still have them around.

The various log files can be found here: ~/.config/cli-chess/ and end in .log.

@turkishfilms
Copy link
Author

Log files

@trevorbayless
Copy link
Owner

Thanks for supplying the logs! Below are the moves made in the game:

d2d4 g8f6 e2e3 d7d5 f1d3 c7c5 c2c4 d5c4 d3c4 e7e6 c1d2 c5d4 c4e2 d4e3 d2e3 b7b5 e2b5 f8b4 b1c3 e8g8 a2a3 b4c3 b2c3 b8c6 e3g5 d8d1 e2d1 f6e4 g1f3 e4c3 h2h4 h7h6 g5c1 f8d8 d1c2 c6d4 e1d2 d4c2 d2c2 c3d5 c2b3 b7b6 a3a4 c8a6 a1b1 a8c8 b3b2 d5b4 f3e1 a6d3 g2g4 d3b1 e1g2 b1e4 b2a3 b4c2 a3a2 e4g2 h1g1 g2d5 a2b1 c2d4 c1d2 d4f3 d2a5 f3g1 a5e1 d5e4 b1a2 c8c2 a2a1 d8d1

The moves in green are good and end with the engine checking you on e2b5. Somehow you were able to continue the game without acknowledging the check (red section)

+ d2d4 g8f6 e2e3 d7d5 f1d3 c7c5 c2c4 d5c4 d3c4 e7e6 c1d2 c5d4 c4e2 d4e3 d2e3 b7b5 e2b5
- f8b4 b1c3 e8g8 a2a3 b4c3 b2c3 b8c6 e3g5 d8d1 e2d1 f6e4 g1f3 e4c3 h2h4 h7h6 g5c1 f8d8 d1c2 c6d4 e1d2 d4c2 d2c2 c3d5 c2b3 b7b6 a3a4 c8a6 a1b1 a8c8 b3b2 d5b4 f3e1 a6d3 g2g4 d3b1 e1g2 b1e4 b2a3 b4c2 a3a2 e4g2 h1g1 g2d5 a2b1 c2d4 c1d2 d4f3 d2a5 f3g1 a5e1 d5e4 b1a2 c8c2 a2a1 d8d1

The position up to green looked like this for you:
image

I have some follow up questions:

  • Do you recall if you used the "takeback" feature to make a new move after the engine checked you, or at any other point in the game? (I realize now that I don't log these events, so this could explain how you were able to seemingly "continue on" without acknowledging the check - I'll need to update the logging to account for this).

  • Did you have multiple instances of cli-chess open?

@turkishfilms
Copy link
Author

I believe I did you take back in this game to see how it would work. I may have us
ed it around this time. I only had one instance running. I would be very interested to help you get to the bottom of this. Perhaps a
lso outputting a pgn of the game would be helpful. I'll look into your code more and may send a pr your way

trevorbayless added a commit that referenced this issue Nov 29, 2024
The base model update method was being called before we report the game
has ended. This caused a delay in reporting of the game over status.
trevorbayless added a commit that referenced this issue Nov 29, 2024
@trevorbayless
Copy link
Owner

trevorbayless commented Nov 29, 2024

I've released a new version of cli-chess (v1.4.2) which from my testing addresses this issue. It also adds additional logging which should make root cause discovery next time a little quicker. Feel free to try out the new version and open a bug report if you run into this again, or any other issues! Also, I saw in the logs you attempted to type nc6 for example and cli-chess rejected it. If you want to use SAN notation you need to capitalize the first letter (e.g. Nc6).

As far as producing a PGN at the end of the game, it's been requested (#19) and I'd happily review any PR that comes across for it!

I'm closing this enhancement as you should always see a proper game over message when a game completes. Hopefully the changes in v1.4.2 actually make that happen for you now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants