CozyWorld game guide · By CozyWorld

This guide covers our own game, written from the current game rules and browser checks.

How to Play Dots and Boxes: Rules and Strategy

Dots and boxes is the pencil-and-paper game of joining dots and claiming boxes. Here are the rules, board sizes and extra turns, then the strategy that wins: safe lines, chains, leaving the last two boxes and the long chain rule, with how strong each level of our computer opponent is.

Dots and boxes is a pencil-and-paper game for two players. Starting from a grid of dots, the players take turns joining two dots side by side with a line, and whoever draws the fourth side of a box claims it and draws again. When the lines run out, the player with more boxes wins. The rules take a minute to learn and the board fits on the back of an envelope, yet under them sits a contest over chains of boxes that the mathematician Elwyn Berlekamp wrote a whole book about.

This guide covers the standard rules, board sizes, extra turns and how a game ends, then the strategy that separates a casual player from a strong one: safe lines, chains, leaving the last two boxes and the long chain rule. It also shows the controls in Larkspur Lookout Dots and Boxes (CozyWorld’s free dots and boxes game against Pebble the pika, in a mountain fire lookout) and how strong each of Pebble’s levels is. The strength figures come from our own simulation, which plays the game’s real rules.

Larkspur Lookout Dots and Boxes: the cabin of a cartoon mountain fire lookout, with windows all along the wall onto snowy blue ranges and pine forest under the title, and a spiral notepad turned a little on a contour map on the table, holding a game in progress with lines in red and indigo pencil, four boxes along the bottom row filled with red camp mugs, two boxes filled with a pika’s face, and a yellow pencil drawing the next line, while Pebble, a round cartoon pika in a red striped scarf with a sprig of larkspur behind her ear, cheers from her blue cushion on the right beside her haypile of wildflowers, and binoculars and a red mug of cocoa sit on the left.

What is dots and boxes?

Dots and boxes is a game for two players, sometimes more, played with a pencil on a grid of dots. Wikipedia’s article on the game says it was first published in the 19th century by the French mathematician Édouard Lucas, who called it la pipopipette, and that it has gone by many other names, among them dots and dashes, the game of dots, boxes and pigs in a pen.

The board can be any size. Boards are usually counted in boxes, so a 4 by 4 game has 16 boxes inside a square of 5 by 5 dots. Wikipedia suggests a small board for learning or when time is short, and calls a 5 by 5 board good for experts. Larkspur Lookout Dots and Boxes offers 3 by 3, 4 by 4 (the default), 5 by 5 and 6 by 6 boxes.

Board sizes in Larkspur Lookout Dots and Boxes
BoardDotsLines to drawBoxesBoxes needed to win
3 by 3 boxes162495
4 by 4 boxes2540169 (8 each is a tie)
5 by 5 boxes36602513
6 by 6 boxes49843619 (18 each is a tie)

Dots and boxes rules

The game starts with an empty grid of dots. The players take turns drawing a single line, across or down, between two dots side by side that are not yet joined. Lines never run diagonally, never skip a dot, and a line once drawn stays drawn.

A player who draws the fourth side of a box claims it. On paper you write your initial inside it; in Larkspur Lookout Dots and Boxes the box fills with your mark, a red camp mug for you and Pebble’s face for her. The player who claims a box then draws another line, as the next section explains.

The game ends when every line has been drawn, which also means every box has been claimed. The player with more boxes wins. A board with an even number of boxes, such as 4 by 4 or 6 by 6, can end in a tie.

Every line starts undrawn, including the lines around the outside of the board. Wikipedia calls this standard version an American board, and a version that starts with the outside lines already drawn a Swedish board.

Actual Larkspur Lookout Dots and Boxes gameplay on a desktop browser: the spiral notepad in the middle of the lookout’s map table with a game in progress on the 4 by 4 board, lines in red and indigo pencil, boxes filled with red camp mugs and with Pebble’s face, the last turn under a yellow highlighter, the scoreboard sign and Pebble the pika on her cushion at the left, and Undo, Hint and Menu on the right.
Actual browser gameplay on a desktop screen, partway through a game against Gentle Pebble.

Extra turns and double boxes

Claiming a box earns another line straight away, and if that line closes a box too, you draw again, so one turn can sweep up a whole row of boxes. Your turn ends only when you draw a line that closes no box.

One line can close two boxes at once when it is the fourth side of the boxes on both sides of it. You claim both, and you still draw just one more line. Julian West, writing about championship play in the 1996 collection Games of No Chance, calls a move like this a double-crossing move; Science News called it a doublecrossed move.

Taking a box is a choice, not a duty. You may draw a line somewhere else and leave a box with three sides for your opponent. Beginners rarely do, but the strongest move in the game, leaving the last two boxes of a chain, depends on it.

Controls in Larkspur Lookout Dots and Boxes

Tap near the line you want. The tap areas are generous: a tap need not land on the line, and a tap between lines picks the nearest one still open. Press and hold to see the line previewed in pencil, slide to another line if you like, and let go to draw it. With a mouse, the line under the pointer is previewed before you click.

Boxes you claim fill with your camp mug on a coral tint, and Pebble’s with her face on lavender. In a game with a friend, Player 2’s boxes get a pine tree on sage. The lines of the last turn sit under a yellow highlighter, so after Pebble draws you can see exactly what she did. With warnings on, a line you aim at shades any box it would leave with three sides.

On a keyboard, the arrow keys move a visible focus from line to line, and Enter or Space draws the line in focus. U undoes, H asks for a hint, and Escape clears the hint.

Undo takes back your last line together with Pebble’s lines after it, as many times as you like. Hint asks the same search that Sharp Pebble uses for your best line and says why: take a box, leave the last two boxes of a chain, split a two-box chain, play a safe line, or give away the fewest boxes. Menu starts a new game and opens Settings, where you choose your opponent, the board, who draws first, Pebble’s speed and the warnings. Statistics are kept for each level, and your game is saved on your device as you play.

Beginner strategy: safe lines

Early in a game, never draw the third side of a box unless you must. A box with three sides is a free box for your opponent, who takes it and draws again. A line that leaves no box with three sides is called a safe line here, and in the opening most lines are safe.

Take the free boxes you are given, but look first. Each box you take means one more line to draw, and that line may be the one that hands back more than you took.

The safe lines run out. Wikipedia describes the usual pattern: novices draw lines more or less at random while avoiding third sides, until every open box belongs to a chain, and then every line gives something away. What happens next decides most games.

Chains and loops

A chain is a row of open boxes, each with two sides drawn, joined through their open sides, so that drawing any line in it lets the other player take the whole row one box after another. A loop is a chain that closes on itself, like a ring of boxes around a drawn block.

Once only chains are left, a player must open one of them. Wikipedia notes that players typically take every box available and then open the smallest chain to their opponent. That is sound as far as it goes: hand over as few boxes as you can.

A chain of one or two boxes is short; a chain of three or more is long. West explains why three is the dividing line: from a chain of three boxes or more, you can always take the rest and still leave the last two with a single line.

The double-cross: leaving the last two boxes

Suppose your opponent opens a long chain for you. You could take every box, but then you must draw another line, and if only chains are left, you have to open the next one for them. Wikipedia describes what an experienced player does instead, which it calls the double-cross strategy: take all but the last two boxes of the chain, then draw the line at the far end of those two, handing them back as a pair.

Your opponent takes the pair with one line that closes both boxes, a double-crossed move, and then has to draw again, opening the next chain for you. You give up two boxes to keep control, and with the next chain you can do the same. West writes that once you know how to decline the last two boxes of a chain, you can beat most casual players.

To decline a loop you must leave four boxes instead of two, West explains, so keeping control after a loop is opened costs more, and it is worth it only when the boxes still to come pay for it.

Control is worth fighting for. Wikipedia says the player who first opens a long chain usually loses, so between experts the game becomes a battle over who will have to open the first long chain.

When you must hand over a chain of exactly two boxes, draw its middle line. That splits it into two single boxes with three sides each, so your opponent cannot take one and hand the other back to keep control. West calls this a hard-hearted handout. Drawing an end line of the pair instead lets your opponent decline them.

The long chain rule

Who ends up with control depends on how many long chains the board has at the end, and that can be steered long before the chains appear. In a 2003 Science News article on the game, Ivars Peterson gave the long chain rule from Berlekamp’s book The Dots-and-Boxes Game: try to make the number of initial dots plus the number of eventual long chains even if you play first, and odd if you play second.

In a straightforward game, the number of double-crossed moves is one fewer than the number of long chains, as both Science News and West point out. West gives the same rule in that form: the first player wants the dots plus the double-crossed moves to come out odd.

Applied to each board in Larkspur Lookout Dots and Boxes, the rule gives the table below. If the board is heading for the wrong number of long chains, split one up or join two together while there are still safe lines left. It is a rule of thumb about control, not a promise: the boxes given away along the way still have to be counted.

On the smallest board the outcome is known. Science News reported that an alert player starting second can always win a game of nine boxes, and our own computation with the game’s exact search agrees: from the empty 3 by 3 board, best play on both sides gives the second player 6 boxes to 3.

The long chain rule on each board: what the first and second players want
BoardDotsFirst player wantsSecond player wants
3 by 3 boxes16An even number of long chainsAn odd number of long chains
4 by 4 boxes25An odd number of long chainsAn even number of long chains
5 by 5 boxes36An even number of long chainsAn odd number of long chains
6 by 6 boxes49An odd number of long chainsAn even number of long chains

How strong is each level?

Pebble has three levels. Gentle always takes a box she can take; otherwise half of her lines are a safe line when one is left, and the rest are any line at all, so she often hands you a box. Steady takes every box she can, plays a safe line while one is left, and when every line gives boxes away she draws the line that gives the fewest. She never turns boxes down. Sharp knows about chains and control: she leaves the last two boxes of a chain, or the last four of a loop, whenever that wins more, and once the safe lines are few she searches ahead turn by turn, working out the endgame of chains and loops exactly whenever her search budget allows.

To check that each level does what it says, we ran our own simulation of 1,000 games for each pairing on the 4 by 4 board, with the two players taking turns to draw the first line, so each went first in 500. A random player draws any open line. The scripted beginner takes any box it can, otherwise draws a safe line, and otherwise draws any line, which is the habit most people learn in their first few games. It does not count chains or look ahead.

The beginner beat Gentle about two games in three, so Gentle really is beatable while you learn. Steady has exactly the beginner’s habits except one: when every line gives boxes away, she gives the fewest. That alone made her the winner most of the time. Sharp lost very few games to anyone. These are computer players, not people, so treat the numbers as a guide to the gap between the levels.

Our simulation: 1,000 games per pairing on 4 by 4 boxes, first line taken in turn
PairingWonLostTied
Gentle against a random player1,00000
Steady against a random player1,00000
Sharp against a random player1,00000
Scripted beginner against Gentle667230103
Scripted beginner against Steady12977299
Scripted beginner against Sharp497521
Steady against Gentle8836354
Sharp against Gentle987211
Sharp against Steady947746

Do the levels hold up on other boards?

We also ran our simulation on the other three boards, with 200 games for each pairing and the first line again taken in turn. On every board the scripted beginner beat Gentle at least two games in three, so Gentle stays a friendly place to learn whatever the size.

Against the beginner, Steady and Sharp grew harder to beat as the board grew. On 6 by 6 boxes the beginner won 5 of 200 games against Steady and none against Sharp. Sharp beat Steady most of the time on every board.

Our simulation on the other boards: games won of 200 per pairing
BoardBeginner against GentleBeginner against SteadyBeginner against SharpSharp against Steady
3 by 3 boxes135452192
5 by 5 boxes154160194
6 by 6 boxes16050176

Common mistakes

Taking every box, every time. Greed is the natural habit, and it is right while chains are short. Once a long chain comes your way, stop before the last two boxes and ask whether keeping control is worth more than the two boxes.

Opening a long chain while a short one is left. If you must hand something over, hand over the fewest boxes: single boxes and two-box chains first, long chains last.

Giving away a two-box chain by its end. Drawing the line at one end of a pair lets your opponent take nothing and hand both boxes back. Draw the middle line instead.

Forgetting the count. Late in the opening, the number of long chains decides who must open the first one. If the count is heading the wrong way for you, use one of the remaining safe lines to split a chain or join two.

Tips for winning more games

Learn on the small board. A 3 by 3 game is short enough to replay many times, and with only a few chains it is easy to see where control was won and lost. Then move up to 4 by 4.

Watch the last turn. The yellow highlighter shows every line of Pebble’s last turn, which makes it easy to spot when she has just left you the last two boxes of a chain on purpose.

Use warnings while you learn, then turn them off. Shading the boxes a line would hand over trains the eye to see third sides, and turning it off later makes the game the same as on paper.

Use undo and the hint. Ask for a hint when you are unsure, read why it likes the line, and use undo to try your own idea and see how Pebble answers. When the hint has worked a position out to the very end of the game, it says so.

Actual Larkspur Lookout Dots and Boxes gameplay on a phone-sized screen: the lookout windows, the scoreboard sign and Pebble the pika on her cushion across the top, the notepad filling the width below with a game in progress, claimed boxes filled with camp mugs and Pebble’s face, the message line, and Undo, Hint and Menu on the shelf at the bottom.
Actual browser gameplay at phone width: the notepad fills the screen, with the tools at the bottom near your thumb.

Keep playing

Dots and boxes rewards one habit above all: count the chains before you hand anything over, and when you are given a long chain, think about leaving the last two boxes. Start against Gentle on the 3 by 3 or 4 by 4 board, keep your lines safe for as long as you can, and move up to Steady when you win more than you lose. For more classic games, try Kingfisher Canal Checkers, our checkers game on a canal boat; Sunflower Mill Mancala, our seed-sowing board game; Meadowlark Barn Shut the Box, our dice and tiles game; or Sprout Sudoku, with hints that explain the next step.

More guides and roundups