How to win dots and boxes: closure rules and strategy

Updated

Play closure

On this page

closure is a free dots-and-boxes game you play in the browser. A grid of dots sits on the board, and you and your opponent take turns drawing a line between two of them. Draw the fourth side of a box and the box is yours, and you move again.

It looks like a game about taking boxes. It is really a game about which lines you are forced to draw once the safe ones run out.

The rules, in thirty seconds

  1. A move. Tap the gap between two neighbouring dots to draw a line there. A line that is already drawn cannot be drawn again.
  2. Closing a box. If your line completes the fourth side of a box, the box is yours and you move again. One line can close two boxes at once.
  3. Taking turns. A line that closes nothing passes the turn to your opponent.
  4. Winning. The first player to own more than half the boxes wins. Every board has an odd number of boxes, so there is always a winner and never a draw.

Against the bot, you always draw the first line. The match also ends if every line has been drawn, though in practice someone passes half the boxes first.

The closure start screen with Solo, Multiplayer and Daily buttons and the board-size selector set to tuned Pick the board size before anything else: it changes the bot as well as the grid, so loose, tuned and ruthless are three different opponents.

The third side is the whole game

A box with three sides drawn is a gift. Whoever moves next can close it for free, and then move again.

So early on, both players draw safe lines: lines that close nothing and leave every box they touch with two sides or fewer. For a while the board fills up and nothing happens.

Then the safe lines run out. From that moment, every line either closes a box or hands one over. The player who has to move first in that position is usually in trouble, because they have to open something.

Chains, and why size matters

By the time the safe lines are gone, the undrawn boxes have usually joined into chains: runs of boxes where closing one opens the next. Hand your opponent one box in a chain and they can close it, move again, close the next, and run the whole thing.

That makes the choice of what to open the real decision. Opening a chain of two costs you two boxes. Opening a chain of six costs you six. When you are forced to give something away, give away the shortest chain on the board, and keep the long ones for later.

Why giving boxes away wins

Here is the move that separates beginners from strong players.

When your opponent opens a long chain for you, you do not have to take all of it. Take every box except the last two, then draw the line at the far end of those two instead of closing them. Your opponent gets two boxes for free, but they must then move again, and in a board with no safe lines left, that means opening the next chain for you.

Two boxes given up now buys you the next chain, and often the one after that. Across a long endgame, the player who keeps this control usually wins by a wide margin, even though they gave boxes away on purpose.

It only pays when there is another chain still to come. On the last chain of the game, take everything.

A worked example

You are handed a chain of 4 boxes, and one chain of 6 is still on the board with no safe lines left. Take 2 boxes, then leave the last 2 with the double-dealing line. Your opponent takes those 2, then has to move, and the only moves left open the 6-chain. Final tally from this position: you 2 + 6 = 8, them 2. Had you taken all 4, you would have been the one to open the 6-chain: you 4, them 6.

An early closure match on a 3 by 5 board with two green lines and two orange lines drawn and no boxes claimed yet Early in a match: count the undrawn lines that would not give a third side. When that count reaches zero, the next player to move must open something.

How big is the quiet phase?

The number of lines tells you how long the quiet phase can last. A board with r rows and c columns of boxes has (r+1) x c horizontal lines and r x (c+1) vertical ones:

  • loose, 3x3: 12 + 12 = 24 lines for 9 boxes
  • tuned, 3x5: 20 + 18 = 38 lines for 15 boxes
  • ruthless, 5x5: 30 + 30 = 60 lines for 25 boxes

Only some of those can be drawn safely, because every box allows at most two sides before it becomes a gift. That ceiling is why the quiet phase ends well before the board is full, and why it is worth counting.

Playing each bot, from what it actually does

The bot’s rules are short, so they can be read straight from its logic.

  • loose closes a box it could take only about 6 times in 10. The rest of the time, and whenever no box is on offer, it draws a random line, including lines that give you a third side. Take what it hands you and do not overthink it.
  • tuned always takes a box it can close. Otherwise it draws a random safe line, and only when none is left does it draw a random line of any kind. It never looks at chain length, so it opens a long chain as easily as a short one. Your job is to be the one with a safe line left when the safe lines run out.
  • ruthless behaves like tuned until the safe lines are gone. Then, instead of drawing at random, it tests each remaining line and plays the one that gives you the fewest boxes. Do not expect it to open a long chain early.

Tuned and ruthless always close an available box and never deliberately leave the last two boxes of a chain. That makes the double-dealing move in the previous section reliable against them: leave the two-box pair, they take both, and they have to move next. Loose only deliberately takes an available box 60 percent of the time; otherwise it picks a random legal line, which can still close a box. Do not rely on it taking the pair immediately.

Strategy

Count safe lines before you draw. Near the end of the quiet phase, count how many safe lines remain. If the count means you will be the one forced to open the first chain, look for a way to change it, such as closing a box early or opening the smallest thing on the board while it is still small.

Do not create a third side while a safe line exists. It hands over a box and the turn together, for nothing.

Take free boxes, unless you are keeping control. A box sitting on three sides is almost always worth taking. The exception is the end of a chain, as above.

Watch the majority, not just the total. The match ends the moment someone owns more than half the boxes, so on a small board a couple of early gifts can decide it before any chain is played.

The three board sizes

The board and the opponent change together.

  • loose - a 3x3 board, 9 boxes, first to 5. The bot closes a box it could take about six times in ten and otherwise draws a random line, so it hands you boxes by accident. Good for learning how a chain runs.
  • tuned - a 3x5 board, 15 boxes, first to 8. The default. The bot takes every box it can and will not give you a third side while it has a safe line. Once the safe lines are gone it draws a random line, so it does not choose the smallest chain to open.
  • ruthless - a 5x5 board, 25 boxes, first to 13. The same bot, plus one addition: when no safe line is left and it has to give something away, it draws the line that opens the fewest boxes, so the longer chains stay on the board.

Scoring

A win scores 100 points plus 10 for every box in your winning margin, multiplied by 0.7 on loose, 1 on tuned and 1.4 on ruthless. A loss scores nothing, and there is no draw to score. Three worked examples:

  • tuned, 8 to 5: margin 3, (100 + 30) x 1 = 130
  • loose, 5 to 3: margin 2, (100 + 20) x 0.7 = 84
  • ruthless, 13 to 6: margin 7, (100 + 70) x 1.4 = 238

The margin is measured when the match stops, which is the moment someone reaches the winning count. That makes boxes you deny the bot early worth as much as boxes you take, and it means nothing you could have taken afterwards adds to the score.

The result screen shows five numbers: score, boxes, most boxes in one line, sacrifices and level. Two are easy to misread. “Sacrifices” counts lines you drew that gave away a third side while a safe line was still available, so a high number usually means you were careless early. “Most boxes in one line” is the most you closed with a single line, which on this game is one or two, not the length of a chain you ran.

The daily match

Pick Today’s run and every player faces the same bot behaviour on the same UTC day. Your first match of the day on each board size is the scored one, and it is used up when the match starts, even if you quit it. Rematches that day are practice and are not submitted. The bot resets at midnight UTC.

Playing a friend

Choose Multiplayer, pick a board size and create a private room. Send its invite link to a friend, ready up in the lobby, then let the host start. Both players see each line as it is drawn. Reopen the link in the same browser to resume; clearing site data can lose your anonymous seat.

Multiplayer needs the game server to pass moves between you. If the server is unreachable, a room cannot be opened, but solo play still works. Matches between friends have private room standings rather than entries on the public solo leaderboard.

A practice routine

  1. Start on loose and play until you can say, before each move, whether it leaves any box on three sides. The bot’s randomness makes this a low-pressure place to learn what a third side looks like.
  2. Move to tuned and aim to reach the end of the quiet phase with the safe lines counted. The bot will not gift you a third side, so you win only by being the player who is not forced to open first.
  3. On tuned, practise the double-deal on purpose: when the bot opens a chain and another chain remains, take all but two and leave the pair.
  4. Only then try ruthless. Its bot picks the cheapest opening, so you will rarely be handed a long chain for free and the 5x5 board rewards the player who counted early.

Design notes

The match stops at a majority rather than playing out the board, so the last few boxes are never drawn. That keeps the boxes still open from mattering once a result is certain, and a result is always reached because every board has an odd number of boxes (9, 15 and 25).

The bot waits 600 ms before each line so you can follow what it did. It is a fixed rule set. Ruthless measures how many boxes each opening would give away but does not search ahead through later moves, so the difference between levels is in what it notices, not in how deeply it calculates. In private rooms the server checks every move: it rejects a line that is off the board, already drawn, or sent out of turn.

Common mistakes

  • Drawing a third side while a safe line still exists. It gives away a box and the turn for nothing.
  • Taking every box of a chain when another chain is still to come. Take it all on the last chain, or when taking it all wins the match.
  • Forgetting that the match stops at the majority. On the 3x3 board the first to 5 wins and the rest of the board is never played.
  • Counting boxes instead of safe lines. The score looks even until the safe lines run out and someone is forced to open a chain.

Where closure sits

If closure’s forced-move feel appeals, two other games share its structure. bridge is also a two-player game that can never end in a draw, and it uses the same loose, tuned and ruthless bot levels. overload is also played against a bot on those three levels, but it is tic-tac-toe with numbers 1 to 9 that you can each spend only once.

Play closure →

Written by the developer from the game's own code. Spot a mistake? hello@onedge.fun