Chomp

A bar of chocolate. The bottom-left square is poisoned. On your turn, tap a square to eat it together with every square above it and to its right. The computer then takes a bite. Whoever is left with only the poisoned square must eat it, and loses. Try to win from a few different bar sizes. Then tick "show winning squares" and notice that from every bar bigger than 1 × 1 the first player has a safe bite, even though nobody knows a formula for it.

What's going on

Chomp is a finite game with no draws, so every position is either a win for the player about to move or a loss for them. A position is a loss if only the poison is left, and a win if some bite leads to a position that is a loss for the other player. Working backwards from the smallest bars, the computer labels every reachable shape. A 6 × 8 bar has only 3003 possible shapes (each is a staircase of row lengths), so this takes a blink.

The famous fact about Chomp is that the first player always has a winning move, yet the proof does not tell you what it is. The argument: suppose the first player bites off just the top-right square. Either that is a winning move, done, or the second player has a winning reply, some bite that leaves a losing position. But that bite was available to the first player at the start, and it would have eaten the top-right square anyway. So the first player could have made it instead and won. One of the two cases must hold, so a winning first move exists. This is a strategy-stealing argument. It proves a winner exists and gives you no clue how to play.

For a square bar the trick is known: bite the square diagonally next to the poison, leaving an L of two equal arms, then copy whatever your opponent does on the other arm. For a 2-row bar, keep the top row exactly one shorter than the bottom. For 3 rows and more, nobody has a rule, only the search.

Sheet: Strategy stealing. Related demo: Nim, a game where the winning rule is known.