Rules (board.py, positions) → AI (negamax, the whole tree): legal moves
AI (negamax, the whole tree) → Opening book (book.json): computed once
Opening book (book.json) → Project page (JavaScript, no Python)
Terminal (typed Python) → AI (negamax, the whole tree)
Tests (every game) → AI (negamax, the whole tree): never loses
Play against the AI
The AI plays the moves of the book computed by the project's Python program: the best moves of each of the 5,478 positions. At the unbeatable level, it never loses.
Loading the move book…
With the keyboard: arrows move the active square, Enter or Space plays. Level and side apply to the next game.
Tech stack
Python
pytest
mypy
Who does what
Python
The game and the minimax AI that never loses; it also computes the move book the project page uses.
pytest
Proves the AI cannot be beaten by trying every possible game.
mypy
Checks the types in strict mode, on the code and the tests.
Definition of Done
Code reviewed, diff by diff
Unit and integration tests green
Green CI on Linux, Windows and macOS when compiled