This project implements an AI player for the board game Tak.
The AI is built around Minimax with alpha-beta pruning, iterative deepening, and heuristic-based move ordering to efficiently explore the game tree under a strict time limit.
- Iterative deepening search
- Alpha-beta pruning
- Time-limited computation (58 seconds per move)
- Best move preserved at each completed search depth
The evaluation function estimates board positions using multiple strategic factors:
- Control of the center of the board
- Piece type valuation (dolmen, capstone, menhir)
- Path progression toward victory
- Threat detection and blocking
- Material and positional advantage
- Board connectivity and structure formation
- Generation of all valid placement and movement actions
- Stack movement handling according to game rules
- Move ordering heuristic prioritizing:
- central control
- blocking opponent progress
- strengthening connections
- reducing inefficient moves
The AI includes several optimizations beyond standard Minimax:
- Immediate win detection (bypassing search when possible)
- Immediate threat blocking
- Opening strategy with corner occupation
- Move filtering and prioritization of critical actions
The main implementation is organized into the following files:
Helper subclass of Board.java used to access certain private methods of the Board class.
File: BoardHelper.java
Implements the AI strategy based on a Minimax algorithm with alpha-beta pruning, heuristic evaluation, and move ordering to improve pruning efficiency.
File: hjaumotte.java
- Clone the repository
git clone https://github.com/hugo-jaumotte/Minimax-algorithm-TAK-game.git
cd Minimax-algorithm-TAK-game- Open the project in IntelliJ IDEA (recommended)
- Run the main class (BelegTak.java)
This project is based on a Tak game engine codebase provided by the professor as part of the course.
Original repository: https://github.com/belegkarnil/BelegTak
Original documentation: https://belegkarnil.github.io/BelegTak/framed.html
Original author: Belegkarnil
License: MIT
The original code was used as a starting point and has been modified and extended.
