demo.mp4
Terminal Othello where two alpha-beta minimax agents play each other live. Built from scratch in Python — no third-party dependencies.
git clone https://github.com/<you>/reversi
cd reversi
python play.py
Requires Python 3.9+. No pip install step — the game uses only the standard library. Press ESC or Q at any point to quit.
Each turn an AiController spawns a Brain thread that runs AlphaBetaPruner.find_best_move. The pruner does iterative deepening from depth 1 upward, returning the best move from the deepest fully completed iteration before time expires. Evaluation weights piece count, corner control, and edge presence; corners dominate because they can never be flipped.
reversi/
├── README.md
├── requirements.txt
├── play.py # entry point
├── demo.mp4
└── src/
└── reversi/
├── settings.py # constants, direction vectors, helpers
├── piece.py # Piece (single cell)
├── board.py # Board (8×8 state, rules, captures)
├── ai.py # AlphaBetaPruner
├── brain.py # threading.Thread wrapper for the search
├── controllers.py # AiController
├── game.py # turn loop
└── ui.py # curses UI