Classic rules · 3 × 3 · X starts
Tic-tac-toe · How the computer thinks
The same position, different ways to search. Compare actual computation while keeping the meaning of the result unchanged.
How the computer chooses a move
Choose a method and follow the example step by step.
The computer checks legal continuations until a win or draw, then carries their outcomes back. At every turn it chooses what is best for the player to move.
Start with the possible moves
X is to move. The three choices are below. We need O's replies before choosing the best outcome.
Left and Right change steps; Home and End jump to the start and end.
What saves search work?
Now compare four methods on the same position. Each should find the same exact result. Compare the actual visit counts: which method saved work?
The board shows the starting position. X and O take empty cells in turn; three marks in a row end the game.
Choose a position and press “Compare searches”. Selecting a position does not start a calculation.
Every method solves the same position. Compare how many nodes each actually visits. Fewer nodes do not mean stronger play: the exact result should agree. Bars count position visits, including repeated visits and cache hits. They do not count unique boards or measure running time.
Counts and what they mean
Memory reuses a previously computed position. Pruning skips unnecessary next moves: this counts those moves, not every hidden descendant below them.
Inspect the actual search
Step through actual visits. The new mark is highlighted; when changing branches, the left board shows the new parent position.
Steps follow the order positions were entered. Evaluations are outcomes after the calculation finishes, not values already known on entry.
Left and Right change steps; Home and End jump to the start and end.
What the numeric evaluations mean
Values are from X's perspective: +1 means X wins, 0 a draw, −1 O wins. A bound is not an exact answer: ≥ 0 allows either a draw or an X win.
Compare strategies
We select 16 different openings after 0–2 moves, all allowing a draw with best play. Each is played twice with the strategies swapping seats: 32 games in total.
The same seed repeats the experiment. These are results for the selected 32 games, not a win probability or a strength rating.
By default: “Wins and blocks” against “Searches to the end”.