An AI Agent for Ultimate Tic Tac Toe, developed using Monte Carlo Tree Search (MCTS) and Alpha-Beta Pruning algorithms.
Try the AI directly in your browser without installing anything!
👉 https://shinnei.github.io/UltimaTTT-Agent/
The web version is fully serverless, running Python natively in your browser using Pyodide and Web Workers.
This project is part of the Introduction to AI course (Semester 241) at HCMUT, where each group was required to build an AI agent that competes in a round-robin tournament playing Ultimate Tic Tac Toe.
Our goal was to explore and compare different decision-making techniques in adversarial games by implementing:
- MCTS – a search-based AI using simulations and playouts.
- Alpha-Beta Pruning – a classic adversarial search algorithm with custom evaluation functions.
For English readers, please refer to Wikipedia for an overview of the game mechanics:
🔗 https://en.wikipedia.org/wiki/Ultimate_tic-tac-toe
state.py— Core logic for handling the Ultimate Tic Tac Toe board and rules.test_game.py— Entry point for running and visualizing AI matches.Alpha_Beta.py— Alpha-Beta Pruning-based AI agent with heuristic evaluations.MCTS.py— MCTS-based AI agent.index.html,style.css,script.js,worker.js— Frontend and Pyodide Web Worker files for the browser-based UI.
If you prefer running the code locally, there are multiple ways:
python -m http.server 8000Then navigate to http://localhost:8000/index.html.
Use the main() function in main.py or run test_game.py to simulate a match between two agents in the terminal.
- Name: Nguyen Huu Huy Thinh
- Email: dst15092004@gmail.com
- Website: https://shinnei.github.io