Dots and Boxes is won in the second half, when the safe lines run out and whole chains change hands. Three habits do nearly all the work: never draw the third side of a box while a safe line exists, give away the shortest chain when you must, and when you are handed a chain stop two boxes short, so that the computer has to open the next one. In simulation that wins 97% of games against Easy, 88% against Hard and 75% against Expert here — and Expert, which involves no chance at all, loses 24:1 to one fixed list of moves every time.
A line is safe if it leaves no box with three sides. While both players draw only safe lines, nobody takes anything. On this board that lasts for half the game: with both sides picking safe lines at random, the safe lines ran out after 30 of the 60 lines on average, and never earlier than line 26 or later than line 34 in 3,000 games.
What a careless third side costs is easy to measure against Easy, the weakest level:
| Your play | Wins against Easy |
|---|---|
| Any line at random | 0 of 10,000 (less than one box a game) |
| Take every box on offer, otherwise at random | 3.6% |
| The same, but only safe lines while one exists | 47% |
The last row is exactly how Easy itself plays, so 47% is what you get for doing no more than it does. Everything above that comes from the second half of the game.
When the safe lines run out, the board has typically broken into about three long chains (three boxes or more) and three short ones, and the longest chain is 7 or 8 boxes on average. One position in five contains a loop. And in 91% of positions some box still has three or four open sides — a junction where chains meet — so the picture goes on changing as the first sacrifices are made.
Sooner or later every line left gives the opponent a box. Then count what each line gives and open the cheapest. That is the only difference between Hard and Easy on this page, and for a player it is the biggest single step: against Easy it lifts the win rate from 47% to 85%, against Hard from 7% to 41%, against Expert from 4% to 25%.
A chain of two boxes needs extra care, because it has three lines you can open it with, and they are not the same:
Expert knows the difference. In a test position with a two-box chain and four chains of five, we opened the short chain at the end: Expert declined both boxes. Opened in the middle, it took both and then had to open a chain of five. Easy and Hard take the two boxes either way.
Against Easy and Hard, therefore, it does not matter where you open a two-box chain. Against Expert it does: the same player won 75.5% of 3,000 games opening two-box chains in the middle and 68% of 1,500 opening them anywhere.
When you are handed a chain, the natural thing is to take all of it — and then, with no safe line left, to open the next chain for your opponent. The alternative is to take all but the last two boxes and draw the line that leaves those two to him with a single stroke. He takes them, and it is still he who must open the next chain. You pay two boxes per chain to stay in control, and you take the last chain whole.
How much that is worth can be calculated exactly. Take a position in which only rows of five boxes are left — every horizontal line drawn, the vertical ones not — and it is your opponent's turn to open one. We solved these positions by exhaustive search:
| Chains of five left | Both sides take everything | Best play (exact) |
|---|---|---|
| 2 | 5:5 | 8:2 to you |
| 3 | 10:5 to you | 11:4 to you |
| 4 | 10:10 | 14:6 to you |
With four chains the trick turns a level ending into a win by eight boxes. In whole games the effect is just as plain. A player who takes boxes, plays safe lines at random and sacrifices the cheapest chain wins 86% against Easy, 41% against Hard and 24% against Expert. Add all-but-two and the figures become 97%, 88% and 75%; against Hard that is 4.7 more boxes a game on average.
The chain rule is the part of the theory that tells you, before any box is taken, who will end up in control. Its exact form, from Berlekamp's book: the number of dots plus the number of double-crossed moves — lines that close two boxes at once — equals the number of turns in the game. This board has 36 dots. You move first, so you have the last turn exactly when the number of double-crossed moves is odd. We checked 4,500 simulated games: the identity held in every one.
The last turn is usually the last and largest chain. Between two players who both follow Hard's rule, the side with the last turn won 90% of 2,000 games and the other side 3%.
The practical form of the rule follows from it: with 36 dots the first player — you — wants an even number of long chains on the board, and the computer wants an odd number. Loops are not counted. One piece of this can be seen directly. Once the board consists of separate chains only, the lines left number 25 plus the number of chains, so the computer has to open first exactly when the number of chains of all lengths is even. That held in all 357 such positions in our games.
Now the honest part. Against the three levels here, the chain rule decides very little:
The reason is that the rule assumes an opponent who fights for control. Easy and Hard give it back the first time they take a chain, and Expert gives it back often enough. Against them, what you do with a chain once you have it matters far more than who opens first. Against a strong human, count the chains.
| Easy | Hard | Expert | |
|---|---|---|---|
| Forced sacrifice | a random line | the cheapest | the cheapest |
| Handed a chain | takes all of it | takes all of it | takes all but two when that pays |
| Handed a loop | takes all four | takes all four | takes all four |
| Two-box chain opened at the end | takes both | takes both | declines when that pays |
| Same moves, same replies? | no | no | yes |
And this is how simple ways of playing do against each level (you move first; choices between equal lines are made at random):
| Your play | vs Easy | vs Hard | vs Expert |
|---|---|---|---|
| Any line at random | 0% | 0% | 0% |
| Take every box, otherwise at random | 3.6% | 0.3% | 0.5% |
| + only safe lines while one exists (Easy's own play) | 47% | 7% | 4% |
| + the cheapest sacrifice (Hard's own play) | 85% | 41% | 25% |
| + all but two when a long chain is left; two-box chains opened in the middle | 97% | 88% | 75% |
| + counting the last twelve safe lines | 98% | 88% | 76% |
10,000 games for each figure against Easy and Hard (3,000 in the last row), 3,000 against Expert (1,000 in the last row). Note the 41%: playing exactly as Hard does and moving first, you win fewer than half the games — 40% in a separate run of 5,000.
Easy and Hard lose to the same thing. They take every box they are offered, so the first long chain you receive gives you control for the rest of the game: take all but two, let the computer have the pair, and it has to open the next chain. Hard only makes you wait longer for that first chain, because it opens the shortest one it has.
Expert plays the double-cross itself, but it has three weaknesses: it takes loops whole; it picks its sacrifice by counting what a greedy player would take; and while more than fourteen lines are left it follows rules instead of calculating. In 500 games against the all-but-two player it opened 2.4 long chains a game and the player 0.8.
Expert also involves no chance, so one won game is won for ever. It answers almost any first move with the top-left line and goes on along the top edge. Dots are named here by column, a–f from the left, and row, 1–6 from the top (the game shows no labels); a1-b1 is the top-left horizontal line.
The game ends 24:1. Expert never has fewer than 24 lines left when it chooses, so its timed endgame search is not used and the speed of your device changes nothing. If Expert ever answers differently, the game's code has changed and the line no longer applies.
The first two rules win 85% of games against Easy but only 41% against Hard and 25% against Expert; the third takes those to 97%, 88% and 75%.
Draw only safe lines while you can, sacrifice the shortest chain when you cannot, and when you are given a chain take all but the last two boxes so your opponent has to open the next one. Against the computer here those three rules win 97% of simulated games on Easy, 88% on Hard and 75% on Expert.
Declining the last two boxes of a chain: instead of taking them, you draw the line that leaves both to your opponent, who closes them with one stroke and then has to open the next chain. It costs two boxes (four in a loop) and keeps you in control. With four chains of five left it turns a 10:10 ending into 14:6, by exact calculation.
Dots plus double-crossed moves equals turns. On a board with 36 dots, like this one, the first player gets the last turn when the number of long chains is even, the second when it is odd. The identity held in all 4,500 games we simulated, but against the computer levels here the count of chains predicted almost nothing, because they give control away.
It depends on the board. We solved the small ones exactly: on 2×2 boxes the first player wins 3:1, on 3×3 the second wins 6:3. The 5×5 board here is too large for that. In our games two identical players following Hard's rule split 40:60 against the one who moved first (5,000 games).
Yes, on every level here. Easy and Hard never decline a box, so taking all but two of the first long chain they give you usually wins the game. Expert has no randomness: the eighteen lines listed on this page, followed by taking everything it opens, beat it 24:1 every time.
Only when no safe line is left, and then as few as possible: against Easy, opening the cheapest chain instead of a random one raises the win rate from 47% to 85%. The other time is the double-cross, where you give up two boxes on purpose to make your opponent open the next chain.