Score
0
Best
-
A classic strategy puzzle that is secretly the ancient game of Nim. Six rows, one checker each for you and the AI: slide toward the other piece or back away, and whoever closes the last gap traps the opponent. No luck — just one neat piece of arithmetic.
The board has six rows of eight squares. Every row holds exactly two pieces: your orange round checker on the left and the AI's blue diamond on the right. The number at the end of each row is its gap — how many empty squares lie between the two pieces. You always move first.
On your turn, choose any one row and slide your checker in it as many squares as you like, either forward toward the AI's piece or backward toward the left edge. You cannot jump over the AI's piece, land on it, or leave the board, and you must actually move. To move, press the square you want your checker to reach: a dashed preview appears there. Slide your finger along the row to adjust it and lift to move. Lift outside the board to cancel. Squares past the AI's piece are dark because you can never reach them.
The AI then moves one of its own pieces the same way. It only ever moves forward, toward you; the square it just left is striped and the piece it just moved is outlined in white.
A row is closed when its two pieces touch and its gap is 0. When all six rows are closed, the player whose turn it is loses. In the full game that player could still back away, but every step back can simply be followed by the opponent until they are pinned against the wall, so the result is decided at that moment. In practice: close the last open gap on your move and you win.
Beat the AI and the next game starts with your win streak growing; your score is that streak. Every win also makes the AI more careful — it makes fewer loose moves the longer your streak runs. Lose once and the streak is over; you can save it to the Hall of Fame from the result card.
Forget the checkers and look only at the gap numbers: they are the heaps of Nim, the oldest solved strategy game. Moving forward shrinks one gap by any amount, exactly like taking counters from one heap. Moving backward makes a gap bigger, but that never helps the player who does it, because the opponent can step forward the same distance and undo it. So the whole game is Nim with the six gaps as heaps.
Nim has a complete solution, found by Charles Bouton in 1901. Write each gap in binary — 1, 2 and 4 are enough here because no gap is larger than 6 — and combine them column by column: a column is "odd" if it has an odd number of 1s. If every column is even (the nim-sum is zero), the player to move is losing against perfect play. If any column is odd, there is a move that makes them all even again, and that move wins. For example, gaps of 3, 5 and 6 are 011, 101 and 110: every column has two 1s, so whoever has to move there is losing.
Every new board starts with a nim-sum of zero, so as the first player you begin in a lost position, and the AI, which plays the nim-sum perfectly, only loses when it makes a loose move. Your job is to notice that moment. After each AI move, recompute the columns; if one is odd, find a gap that has a 1 in the highest odd column and shrink it until every column is even again. If everything is already even, make a small forward move in a big gap to give the AI the most chances to go wrong — never back away, since that only hands it more room.
Northcott's Game is one of the disguised Nims described in Winning Ways for Your Mathematical Plays (1982), the classic book on combinatorial games. The disguise works because the backward moves look like extra options while changing nothing. Once you see through it, the board becomes six small numbers, and the only question left on each turn is which one to cut and by how much.