Skip to content

Latest commit

ย 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 

Repository files navigation

Halma Game ๐ŸŽฒ

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.


Features โœจ

  • ๐Ÿ–ผ๏ธ 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

Requirements ๐Ÿ“ฆ

  • 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 images
    • halma.db โ†’ SQLite database (created automatically if missing)

Running the Game โ–ถ๏ธ

python halma.py

Opens the GUI window to start playing.


How to Play ๐ŸŽฎ

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

Controls โŒจ๏ธ

  • 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

AI Details ๐Ÿง 

  • Minimax algorithm with alpha-beta pruning.
  • Evaluates board positions based on piece advancement.
  • Dynamically adjusts move analysis based on difficulty setting.

Project Structure ๐Ÿ“‚

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)

Future Improvements ๐Ÿš€

  • Network multiplayer
  • Stronger AI heuristics
  • Customizable pieces and themes
  • Enhanced statistics and analytics

License ๐Ÿ“

MIT License โ€“ free to use, modify, and distribute.

About

Virtual Halma game with AI, database storage and reviews

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages