Skip to content

Conversation

@ChrisYang0131
Copy link

This pull request introduces an undo feature to the game 2048, allowing users to revert the game state to the previous move. The implementation stores a snapshot of the game state (grid and score) before each valid move and restores it when the undo function is triggered.

Key changes include:

  • Added state caching before moves.
  • Implemented undo() logic in the game manager.
  • Added a simple UI button labeled "Undo" to trigger the functionality.
  • Ensured undo is not available at game start or when no previous move exists.

This feature is intended to improve user experience by allowing them to correct accidental moves or retry strategies.


⚠️ Note: This pull request was made as part of a university course assignment (CS304 - Open Source Software Development, Spring 2025). Please feel free to ignore or close this PR if it does not align with the roadmap or contribution policy of the project. No follow-up is required from maintainers.

Thank you for your time and understanding!

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.

1 participant