python-beginner-projects
python-beginner-projects copied to clipboard
New feature branch
Type of change
- [ ] Added new project
- [x] Bug fix
- [x] New features
- [ ] Enhanced documentation
Changes proposed in this pull request
Project name : Connect Four Game
Short description :
This pull request refactors the Connect Four game logic to improve the winning condition checks and adds an automatic game end after 5 seconds when a player wins. The winner's message display has also been fixed to ensure proper font size fitting within the game window.
Changes Made:
- Refactored the winning_move function to remove redundant checks and improve readability.
- Added a new feature that automatically ends the game 5 seconds after a player wins, providing a smoother transition.
- Fixed UI issues related to the winner's message not fitting in the game window. Adjusted the font size to prevent overflow.
- Minor code cleanup to improve maintainability.
Why These Changes:
- These changes improve both the codebase and user experience:
- The game becomes more responsive with the auto-end feature after a win.
- The code is cleaner and easier to maintain, especially the winning condition checks.
- The game window now properly displays the winner's message without overflow, making the game look more polished.
Related Issues:
- Fixes issue #12 (game not ending automatically after a player wins).
Testing Instructions:
- Launch the game.
- Play until one player wins.
- Observe that the winner's message appears correctly and the game ends automatically after 5 seconds.
Future Improvements:
Consider adding a reset button for players to start a new game without restarting the application.
Checklist
- [x] The code is Python 3 compatible
- [x] I have added relevant comments in my file to make code understandable
- [x] I have added my project in a folder which includes all the necessary files
Greetings! This is an automated message from GitHub Actions. :robot: Your pull request has been received and is awaiting for a review by the repository owner or a maintainer. This may take some time, so please be patient. While you wait, you can continue to work on other issues or pull requests, or explore the project further. Or you can simply relax and enjoy your day. Thank you for your contribution to this project! You are awesome! :star: