This repository contains an implementation of the Gomoku game, combining Python and C++ components to offer a fast and interactive experience.
- Game Logic & UI: Implemented in main.py and render.py.
- Core Evaluations & Heuristics: Implemented in C++ within the src/ folder:
- Move Generation & Rule Enforcement: See moves_generator.cpp and is_won.cpp.
Use the provided Makefile to compile the performance-critical C++ modules:
make
- Install dependencies:
pip install -r requirements.txt
- Run the game:
python3 main.py
- Multiplayer: Use the flag
-p 2
to enable two-player mode. - Depth: Use
-D 10
to set the AI search depth to 10. - Color: Use
-c white
if you want to play as white.
Below is a quick demonstration of gameplay:
- Single-player & Multiplayer Modes: Enjoy different modes using human players or AI.
- Bot Player: The AI uses a minimax algorithm (new_bot_play) with advanced board evaluation.
- Heuristic Evaluations: Leverages bitwise_heuristic and star_heuristic for move scoring.
- Undo & Suggestion: The UI provides undo options (draw_undo_button) and move suggestions (draw_suggestion_button).
- Place a Move: Click on the board.
- Undo a Move: Click the "UNDO" button.
- Move Suggestions: Toggle suggestions using the question mark button.