Draw a line, close a box, take another turn. The trick is knowing when not to.
How this game works
The board is a five-by-five grid of boxes. You and the computer take turns drawing one line between two neighbouring dots. Whoever draws the fourth side of a box claims it, scores a point, and takes another turn. When every line is drawn, the player with more boxes wins.
Tap between two dots to draw a line. Boxes take on the colour of whoever closed them, and a running score stays on screen. The computer takes any box on offer, avoids drawing a third side if it can, and gives away the shortest chain when forced.
A game from 1889
French mathematician Édouard Lucas described the game in 1889 under the name "la pipopipette". It has been a schoolroom favourite ever since, and also a serious subject for mathematicians, because the end of the game turns on a surprisingly deep idea.
The chain rule
Early on it's a game of not drawing the third side of a box. Eventually someone has to, and the board splits into chains of boxes that the other player can take in one go. The player who has to open the first long chain usually loses. When you do hand over a chain, you can sometimes decline the last two boxes with a "double-deal" move that keeps control. Count the chains as the board fills.
- Avoid drawing the third side of any box.
- Count the long chains. The player who opens the first one is often forced to.
- When you take a long chain, consider leaving the last two boxes to keep the move.
Short chains and long chains
When the safe moves run out, the board divides into chains. A short chain of one or two boxes is cheap to give away. A long chain of three or more is worth a lot, because whoever takes the first box can often take them all. That is why the fight is about who will be forced to open the first long chain. Count the chains early and steer the game so that the other player runs out of safe moves first.
Against this computer
The computer takes any box it can, avoids drawing a third side, and gives away the shortest chain when forced. It doesn't plan the endgame in depth, so a player who counts chains and plays the double-deal at the right moment can beat it consistently. Try it on Hard first, then see whether it makes the same choices.
From a prompt
This game started as a short brief to an AI coding tool. You can read it here.
Questions people ask
How do I score a point?
Draw the fourth side of a box. You claim it and take another turn.
How big is the board?
Five by five boxes, with six by six dots.
Does it work on phones?
Yes. Tap between two dots to draw a line.
Keep reading
- Play Mancala Online Free Against the Computer
A sowing game where one well-timed stone can win you a free turn, and one careless move can hand over your whole side.
- Play Four in a Row Online Free vs the Computer
Drop a disc, block a threat, build two at once. A game you can learn in ten seconds and still lose in ten moves.
- Play Reversi Online Free Against the Computer
A game where the lead changes hands all the time, and the player ahead in discs is often the one in trouble.