A full-featured Halma board game implemented in Python with a modern CustomTkinter GUI.
Play against another player, challenge the AI, or analyze past games with move-by-move replay and evaluation.
- ๐ผ๏ธ Modern GUI with CustomTkinter
- ๐จ Customizable board colors and themes (Light, Dark, System)
- ๐ค AI opponent with adjustable difficulty using Minimax + alpha-beta pruning
- ๐ Game analysis mode with replay and best-move evaluation
- ๐ฅ Player management: add, disable, and view stats
- ๐พ Game persistence: stores games and moves in a local SQLite database
- ๐ Move history navigation with keyboard shortcuts and buttons
- Python 3.9+
- Install dependencies:
pip install customtkinter CTkMessagebox pillow- Project files needed:
module.pyโ Database and helper classes (DatabaseManager,MultiColumnListbox)red.png,blue.pngโ Player piece imageshalma.dbโ SQLite database (created automatically if missing)
python halma.pyOpens the GUI window to start playing.
- Play vs Player: Two players take turns moving pieces.
- Play vs AI: Choose difficulty and first mover.
- Analyse Game: Replay saved games and view best-move suggestions.
- Manage Players: Add/disable players and view their statistics.
- Settings: Adjust board size, color scheme, and theme.
- Mouse: Click a piece โ click destination square.
- Enter: Confirm multi-jump moves.
- Arrow Keys:
- โ / โ: Step backward/forward through moves
- โ / โ: Jump to end/beginning of move history
- Minimax algorithm with alpha-beta pruning.
- Evaluates board positions based on piece advancement.
- Dynamically adjusts move analysis based on difficulty setting.
halma/
โโโ halma.py # Main game script (HalmaGame class)
โโโ module.py # Database and helper classes
โโโ red.png # Player 1 piece image
โโโ blue.png # Player 2 piece image
โโโ halma.db # SQLite database (auto-generated)
- Network multiplayer
- Stronger AI heuristics
- Customizable pieces and themes
- Enhanced statistics and analytics
MIT License โ free to use, modify, and distribute.