This project is a chess game implemented in Python using the Tkinter library for the graphical user interface (GUI). The game supports different types of players, including human players and AI players with various strategies (TODO).
- Human vs Human: Two human players can play against each other.
- Human vs AI: A human player can play against an AI player.
- AI vs AI: Two AI players can play against each other.
- AI Strategies: The AI players can use different strategies such as Random, Greedy and Alpha-Beta pruning (in process).
- Timer: Optional timer for each player.
- Game Saving: The game state can be saved and loaded.
- Move History: Keeps track of the move history.
- GUI: Interactive GUI using Tkinter.
- Checkmate: The game ends when a player's king is in checkmate.
- Resignation: A player can resign at any time to end the game.
- Time Expiration: The game ends when a player's time runs out.
- Stalemate: The game ends when a player's king is not in check, but the player has no legal moves.
- Threefold Repetition: The game ends in a draw when the same position occurs three times with the same player to move.
- Insufficient Material: The game ends in a draw when neither player has sufficient material to checkmate the opponent.
-
Clone the repository:
git clone https://github.com/yourusername/chess-game.git cd chess-game
-
Install the required dependencies:
pip install -r requirements.txt
Run the main script to start the game:
python src/main.py
Chess Game Project
├── README.md
├── requirements.txt
└── src
├── controller
│ └── (game logic and controllers)
├── model
│ ├── pieces
│ │ └── (different chess pieces, e.g., Pawn, Rook, Knight, etc.)
│ └── (data models for the game)
├── view
│ └── (GUI components)
└── main.py (entry point of the application)
The UML diagram was generated using pyreverse
and Graphviz.
cd src
pyreverse -o png -p chess_game .
UML is in the documentation/uml
folder.
- Database Integration: Add database integration to store game data, player statistics, etc.
- Alpha-Beta Pruning: Implement the Alpha-Beta pruning strategy for the AI player.
- Game Analysis: Add game analysis features such as move suggestions, game evaluation, etc.
- Refactoring: Refactor the codebase to improve readability and maintainability.
- Themes: Add different themes for the game board and pieces.
- Sound Effects: Add sound effects for different game events.
- Unit Tests: Add unit tests to ensure the correctness of the game logic.
- Documentation: Add detailed documentation for the project.
- Online Multiplayer: Implement online multiplayer support.