Cognivo

Learn Dots and Boxes

Close a box and go again. Count your safe moves.

0 of 4 steps done

Step 1 of 4

Try it

One line a turn

Players take turns joining two neighbouring dots with a line.

Tap between two dots to draw a line.

The story

La Pipopipette, 1889

Édouard Lucas published Dots and Boxes in 1889 as la pipopipette. Almost everyone has played it, and almost nobody has played it well.

The whole story

Édouard Lucas published Dots and Boxes in 1889 under the name la pipopipette, in a collection of mathematical recreations. Lucas is better known for the Tower of Hanoi and for the Lucas numbers, and he described this one as having been invented by his students. It spread as a margin game — the kind played on the back of an exercise book — and for most people that is still where it lives. Which is the joke of it: almost everyone has played Dots and Boxes, and almost nobody has played it well.

A Children's Game With A Literature

Elwyn Berlekamp wrote a whole book on Dots and Boxes. The extra-turn rule is what turns a counting exercise into a game about who is forced to move first.

The whole story

Elwyn Berlekamp — one of the founders of combinatorial game theory — wrote an entire book about it, The Dots and Boxes Game: Sophisticated Child's Play. The theory runs through chain counting, parity, and a body of results about what he called loony endgames. The reason a trivial-looking game supports that is the extra-turn rule. Without it, Dots and Boxes would be a dull exercise in counting. With it, the player who runs out of harmless moves first is compelled to hand over everything, and the whole game becomes a fight over who is forced to move first in the endgame.

The full notes

Everything above, and more, in words, to read or to listen to.

Rules3 sections

One Line A Turn

The board is a grid of dots. On your turn you draw one line between two dots that are next to each other, horizontally or vertically. Diagonals are not allowed. If your line completes the fourth side of a box, that box is yours — write your initial in it — and you move again immediately. You keep going for as long as you keep closing boxes. When every line has been drawn, whoever owns more boxes wins.

  • One line closing two boxes at once is legal and gives one extra turn, not two.
  • You must draw a line on your turn — passing is not allowed, and that is the whole game.

The Extra Turn Is The Game

Everything interesting follows from one rule: closing a box means you go again. So a box with three sides drawn is not a prize sitting on the board — it is a free box for whoever moves next. And because closing it grants another move, if there is a second three-sided box beside it, they take that too, and the one after that. A row of such boxes is a chain, and whoever is handed a chain of five takes all five and then still has to move. That last part is the sting. Taking a chain does not end your turn; it obliges you to open the next one.

  • A three-sided box belongs to whoever moves next, not to whoever made it.
  • Taking a chain does not end your turn. It forces you to open something.

How It Finishes

The game ends when no undrawn line remains. Every box is owned by then — the last line of any box claims it — so the boxes always add up to the full grid. On an odd-sized grid there is an odd number of boxes, so somebody must win: 3×3 gives nine boxes, 5×5 gives twenty-five. A draw is only possible on a board with an even number of boxes.

  • Nine boxes cannot split evenly, so 3×3 can never draw.
  • Count what is left, not what you have — the endgame decides most games.
Strategy4 sections

Count Your Safe Moves

A safe move is a line that leaves every box it touches with fewer than three sides — it gives your opponent nothing. An unsafe move puts a third side on some box, handing it over. The opening is a race to use up safe moves without running out first. Nobody is trying to take boxes yet; both players are filling in lines that cost nothing, and the game is really about who is still holding a safe move when the other has none. That player wins the exchange, because their opponent is compelled to open the first chain. So early on: never put a third side on a box if any other move exists.

  • Never draw the third side of a box while a safe move remains.
  • The opening is not about taking boxes at all. It is about not being the one who runs out.

Chains, And Their Length

When the safe moves run out, the board has resolved into chains: runs of boxes that will all fall to whoever is given the first one. Since you will have to open something, open the shortest chain. Giving away three boxes to take a chain of eight is a good trade, and it is the move that decides most games between players who have both noticed the rule. Counting matters more than it looks. If the total number of chains is odd, the player who opens first generally loses the exchange; if it is even, they generally win. Strong players shape the middlegame to fix that count in their favour long before the chains are forced.

  • Open the shortest chain, always.
  • Count the chains. The parity of that number tells you who wants to move first.

The Double-Cross

Here is the move that separates strong play from everything else, and it looks like a mistake. When your opponent opens a long chain, you do not have to take all of it. You can take every box but the last two, and then play a line straight down the middle of those two — sacrificing them — which ends your turn and forces your opponent to open the next chain. You have given away two boxes to keep control of the board. On a board with several long chains, doing this repeatedly wins games by a wide margin, because the opponent has to open every single chain while you take the bulk of each one. Berlekamp called the resulting positions loony. Declining free boxes is the whole skill.

  • Two boxes is a cheap price for making the other player open everything.
  • If you find yourself taking every box on offer, you are probably losing.

Loops Cost Four

Some regions close into a ring rather than a run — a loop. Loops behave differently from chains in one important way: the double-cross in a loop costs four boxes rather than two, because a loop has to be cut in two places to be declined. That makes loops expensive to hand back, and it flips the parity arithmetic. A board with a loop in it needs the count done again with that in mind, and a player who has read the chains but missed the loop will usually get the endgame exactly backwards.

  • Loops cost four to decline; chains cost two.
  • Spot loops before you count parity, or the count will be wrong.