Skip to content

banatibalazs/chess_py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess Game

Python Version Tkinter Pillow NumPy

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).

Features

  • 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.

Possible outcomes:

  • 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.

Demo Images

Main Menu Special Moves Main Menu

Special Moves

Special Moves Special Moves Special Moves

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/chess-game.git
    cd chess-game
  2. Install the required dependencies:

    pip install -r requirements.txt

Usage

Run the main script to start the game:

python src/main.py

Project Structure

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)

UML Diagram

The UML diagram was generated using pyreverse and Graphviz.

cd src
pyreverse -o png -p chess_game .

UML is in the documentation/uml folder.

Possible Improvements (for the Future)

  • 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages