Skip to content
Games with logic
100%

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.

← Practice

How the computer chooses a move

Choose a method and follow the example step by step.

Which method to explore

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.

Position
Not checked yet
Not checked yet
Not checked yet

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?

Starting position

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.

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”.

Strategies and random seed
First strategy
Second strategy

Back to top
Privacy