This project implements an AI agent to play the board game XOShift using Python.
The agent leverages a minimax algorithm with alpha-beta pruning, iterative deepening, and a heuristic evaluation function to make optimal moves within a set time limit.
The repository also includes the XOShift game logic, a performance evaluation script, and a simple UI.
Figure: The XOShift game environment with the AI agent making moves.
Note: The GIF playback speed has been increased for better loading performance.
- Minimax search with alpha-beta pruning.
- Iterative deepening with time limit control.
- Heuristic-based board evaluation (mobility, threats, forks, open twos).
- Performance evaluation via
evaluate_performance.py. - Complete XOShift rules implemented in
game.py.
-
Clone the repository:
git clone https://github.com/azizi-zahra/xoshift-ai-agent.git cd xoshift-ai-agent -
Install dependencies:
pip install -r requirements.txt
-
Ensure you are using Python 3.10+.
-
Run the game with UI:
python main.py
-
Run performance evaluation:
python evaluate_performance.py
-
Adjust agent settings (time limit, depth) in
your_agent.pyunder the CONFIGURATION section.
-
game.py→ XOShift game logic and rules. -
your_agent.py→ AI agent implementation (minimax + heuristics). -
evaluate_performance.py→ Script to test agent performance. -
ui.py→ Simple game interface. -
agent_loader.py,agent_utils.py,utils.py→ Supporting utilities. -
assets/→ Fonts and other resources.
This project is licensed under the MIT License.