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

Chess Game Fix #1680

Merged
merged 8 commits into from
Dec 23, 2024
Merged

Chess Game Fix #1680

merged 8 commits into from
Dec 23, 2024

Conversation

MostlyKIGuess
Copy link

Fixes #1678 .

  • here's the preview of me running the same game:
sugarlabs.mp4

Changes Made:

  • Worked on correcting the conditions as per the README of https://github.com/douglasbagnall/p4wn/tree/master .
  • The previous conditions was checking perhaps the possibility of the draw and not the draw actually. So it was not needed.
  • Essentially it was implementing what was already implemented in the engine, check
    P4_MOVE_FLAG_DRAW = 64 a draw is available from the README.

Further Improvements

  • The engine is kind of old, I have added comments to understand what conditions is doing what operations. And it just repeats move so once the kid learns to beat one level he can just repeat the moves to do the same.
  • We can use the engine's p4_move2string function to easy our approach in the game. ( I shall perhaps create an issue on this and then work on this).
  • Further tests from the original library can be added if using the same engine.

@MostlyKIGuess MostlyKIGuess changed the title Dev Chess Game Fix Dec 19, 2024
activities/Chess.activity/js/chessGame.js Outdated Show resolved Hide resolved
activities/Chess.activity/js/chessGame.js Outdated Show resolved Hide resolved
activities/Chess.activity/js/chessGame.js Outdated Show resolved Hide resolved
activities/Chess.activity/js/chessGame.js Outdated Show resolved Hide resolved
activities/Chess.activity/js/chessGame.js Outdated Show resolved Hide resolved
activities/Chess.activity/js/chessGame.js Outdated Show resolved Hide resolved
activities/Chess.activity/js/chessGame.js Outdated Show resolved Hide resolved
activities/Chess.activity/js/chessGame.js Outdated Show resolved Hide resolved
activities/Chess.activity/js/chessGame.js Outdated Show resolved Hide resolved
activities/Chess.activity/js/chessGame.js Outdated Show resolved Hide resolved
@MostlyKIGuess
Copy link
Author

@llaske I have tested it for almost all the cases, 3 fold repetation works, win from both the players work, stalemate as well, to get stalemate checked what you can do is, keep the difficulty the lowest and play absolute horrible chess, the opponent will not try to mate you but staemate instead.

@llaske llaske merged commit 0475f41 into llaske:dev Dec 23, 2024
@llaske
Copy link
Owner

llaske commented Dec 23, 2024

Nice. Thanks.

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

Successfully merging this pull request may close these issues.

2 participants