Team project for a graduate Artificial Intelligence course. Placed 1st in both class tournaments.
A competitive Reversi (Othello) agent built for a head-to-head class tournament. Agents connect to a shared game server over a socket and play timed matches. We implemented and compared several decision strategies — from a greedy baseline through alpha-beta search and Monte-Carlo Tree Search to an AlphaZero-style deep reinforcement-learning player — and tuned the strongest configuration for competition.
- 1st place in both course tournaments.
- Bitboard engine (
bit_reversi.py). The board is encoded as two 64-bit integers (one per color), with move generation and piece-flipping implemented as bitwise operations and JIT-compiled with Numba. This made position evaluation dramatically faster, which let the alpha-beta search reach significantly greater depth within the per-move time limit — the main performance edge in the tournament. - Several interchangeable agents that all speak the same socket protocol to the game server, so strategies can be swapped and benchmarked against each other.
| File | Strategy |
|---|---|
greedy_player.py |
One-ply greedy baseline (maximizes immediate flips). |
pruning_player.py |
Minimax with alpha-beta pruning. |
pruning_player_weighted.py |
Alpha-beta with positional/weighted board heuristics. |
pruning_player_timed.py |
Alpha-beta with iterative deepening under a time budget. |
bit_board_pruning_player.py, bit_board_pruning_player_v2.py |
Alpha-beta on top of the bitboard engine for deeper search. |
mcts_player.py |
Monte-Carlo Tree Search (UCT). |
deep_player.py |
AlphaZero-style policy/value network guiding MCTS, using a pretrained 8x8 Othello model. |
agent (*_player.py) <-- socket --> reversi_server.py <-- socket --> opponent agent
Each agent receives the current board and whose turn it is, computes a move within the time limit, and sends it back. multi_game_test.py runs many games head-to-head for evaluation.
Python · NumPy · Numba (JIT-compiled bitboard) · PyTorch (AlphaZero network) · sockets
Start the game server, then connect agents to it (each in its own terminal):
python reversi_server.py
python bit_board_pruning_player_v2.py
python mcts_player.pyTeam project for a graduate AI course; collaborators included HEZR0N, jdelarosaquiros, johne16, and Fernando Canseco (bitboard search optimization). The tournament game server (reversi_server.py, reversi_server_iterative.py) was provided by the course. The deep-RL component adapts alpha-zero-general by Surag Nair, used under the MIT License (retained in alpha_zero_general/LICENSE).