How to Play Nim
Nim is the oldest mathematical game and the one every other combinatorial game is measured against. Simple to play, fully understood, and still a good test of nerve against someone who knows the trick.
The rules
- Several heaps of counters (kawu deals 3, 4 or 5 heaps of up to seven).
- On your turn take one or more counters from a single heap; you may take the whole heap.
- Normal play: whoever takes the last counter wins. Misère: whoever takes the last counter loses.
Playing on kawu
- Tap a counter to take it and everything above it; the chosen counters lift. Tap Take to confirm.
- The nim-sum of the heaps is shown under the board; the strategy page explains it.
- You move first from a position where a winning plan exists. Hard plays perfectly, so one slip loses; normal errs sometimes; easy plays at random.
Next, read the Nim strategy.
Frequently asked questions
Is Nim solved?
Yes, completely. Charles Bouton proved in 1901 that the player to move wins exactly when the nim-sum (the exclusive-or of the heap sizes) is not zero, and showed how to find the winning move. The hard computer plays that strategy.
What is misère Nim?
The same game, except that taking the last counter loses. The strategy is identical until only heaps of one remain; then you leave an odd number of them.
Last updated 2026-10-20