devShakib

Loading devShakib…

Tic-Tac-Toe

Three in a row versus an unbeatable computer. Can you force the draw? Win, loss and draw tally saved.

Three-in-a-row is ancient — Roman versions have been found scratched into stonework — and it is the standard first example in game theory because it is small enough to solve completely. There are 255,168 possible games and only 26,830 distinct board positions once symmetry is removed.

It is a draw with perfect play from both sides, which makes it the classic demonstration of minimax search: the whole tree fits in memory, so an optimal opponent is not merely hard to beat but impossible. Children work this out for themselves at around seven or eight, which is roughly when the game stops being fun.