War of Dots
A territory game on a grid: place your dots in turn, surround the other player's, and the dots you enclose are yours. Play against an AI that learned the game by playing itself, on an Android phone or on Windows.

- Android and Windows
- 3 computer opponents, from Easy to Expert
- 294 automated tests on the rules and the app
What makes the game work
Captures you can trust
Every capture is computed exactly, so the same loop always takes the same dots.

An opponent at your level
Easy while you learn, Hard for a patient game, and Expert, the trained network, which runs on the phone itself. Switch any time and the new opponent carries on from the same position.

Every game kept
Your history lists each game with its result, and any of them can be replayed move by move.

Training that fits on one machine
The AI learns by playing against itself on a single graphics card, and it now learns 3.5 times faster.
New models earn their place
A new version replaces the old one only when it wins by a statistically significant margin.
How it's built
It started as a college assignment. The game is easy to explain and hard to get right, so I kept coming back to it.
- Rules engine
- C++17, shared by the app and the training code
- App
- Kotlin and Compose Multiplatform, for Android and Windows
- Search
- Minimax with alpha-beta, and AlphaZero-style tree search
- Model
- One policy and value network for every board size, trained with PyTorch on CUDA