The Tic-Tac-Toe Blog

The ideas behind the game — the game theory that makes Tic-Tac-Toe a "solved" draw, and the minimax AI that powers the opponent you play against.

Game Theory

Game Theory and Tic-Tac-Toe: Why Perfect Play Always Draws

Payoff matrices, the minimax principle, forks, and the reason two perfect players can never beat each other. A friendly tour of the game theory hiding inside a kids' game.

Read
Inside the AI

How the AI Opponent Thinks: Minimax and the Game Tree

How the Hard AI searches a game tree, why alpha-beta pruning keeps it fast, and why bigger boards stretch it past its limits — giving you a real chance to win.

Read
Inside the AI

How Our Tic-Tac-Toe AI Never Loses: Minimax, Alpha-Beta and a Full-Tree Proof

The engine benchmarked: 0 losses across all 642 reachable 3×3 games, a 93.4% search saving from alpha-beta, and still 0 losses scaling to 6×6 — every number reproducible.

Read

These three posts build on each other. The game theory post starts from first principles — why a payoff matrix and the minimax principle guarantee that two players who never make a mistake will always draw — before either side has written a line of code. The minimax AI post turns that principle into the actual engine behind the Hard difficulty: a full search of the game tree, sped up with alpha-beta pruning so it can still respond instantly even as the board grows past the classic 3×3. The full-tree proof post goes further still, benchmarking that engine across every one of the 642 reachable 3×3 positions and confirming zero losses, then showing the same pruning keeps a perfect 6×6 opponent fast enough to play against in real time. Read them in order, or jump straight to whichever question you came here with.