A fully functional Chess game built using Python and Tkinter, featuring:
- Two Player mode
- Single Player mode vs AI (Minimax with Alpha-Beta Pruning)
- Real-time chess clocks
- Threaded AI computation to keep the UI responsive
- Legal move validation and checkmate detection
This project demonstrates game logic, AI algorithms, multithreading, and GUI development in Python.
This Chess application allows users to play:
- Player vs Player (local)
- Player vs AI (Minimax-based opponent)
The AI uses:
- Minimax algorithm
- Alpha-Beta pruning
- Material-based board evaluation
- Move ordering for better performance
To ensure smooth gameplay, AI thinking runs in a separate thread, preventing UI freezing.
- Complete chess board with Unicode pieces
- AI opponent using Minimax + Alpha-Beta pruning
- Threaded AI processing (non-blocking UI)
- 10-minute chess timers for both players
- Legal move validation
- Check & checkmate detection
- Chess.com-style board colors and highlights
- Menu system to select game mode
- User selects game mode (Two Player / AI)
- White (lowercase pieces) always starts
- Legal moves are calculated for selected pieces
- Game state is updated after every move
- In AI mode:
- Board is evaluated using material values
- Minimax searches the best move up to a fixed depth
- Alpha-Beta pruning improves efficiency
- AI move runs in a background thread
- Game ends on:
- Checkmate
- Stalemate
- Time expiration
- Python
- Tkinter (GUI)
- Minimax Algorithm
- Alpha-Beta Pruning
- Multithreading
- Object-Oriented Programming (OOP)
Python-Chess-AI/
│
├── main.py - Complete chess game & AI logic
├── README.md - Project documentation
└── assets/ - (Optional) icons / screenshots
git clone https://github.com/Vaishuu-creator/Python-Chess-AI
cd Python-Chess-AI
python main.py
No external libraries required
Python 3.8+ recommended
- Launch the game
- Choose Game Mode:
- Two Player
- AI Opponent (Minimax)
- Click a piece to see its legal moves
- Click a highlighted square to move
- Watch the clock — each player has 10 minutes
- Game ends on checkmate, stalemate, or time-out
- White = lowercase pieces (human player)
- Black = uppercase pieces (AI or second player)
- Standard chess movement rules
- Illegal moves are automatically blocked
- King cannot move into check
- Material-based scoring:
- Pawn = 1
- Knight/Bishop = 3
- Rook = 5
- Queen = 9
- King = 200
- Minimax with Alpha-Beta pruning
- Fixed search depth (configurable)
- Capture-priority move ordering
- Implementing Minimax AI
- Alpha-Beta pruning optimization
- Chess rules & state validation
- Multithreading in Python GUI apps
- Tkinter canvas-based rendering
- Timer & event-driven programming
- Adjustable AI difficulty levels
- Piece animations
- Move history panel
- Sound effects
- PGN/FEN support
- Online multiplayer
This project is licensed under the MIT License.
Final Year Computer Technology Student
Aspiring AI / Software Engineer
If you like this project, consider giving it a star!

