Rules
Nim – Rules
One of the oldest strategy games: heaps of wooden sticks, and in turn you take as many as you like from one heap. Whoever takes the last stick wins — or, in misère, loses. It has a perfect strategy; can you find it?
GrokipediaGoal
Take the last stick — or, in the misère game, make your opponent take it.
A move
On your turn take one or more sticks from a single heap — as many as you like, even the whole heap.
The heaps
Play with heaps of 3, 4 and 5 sticks, or with 1, 3, 5 and 7 as in the film Last Year at Marienbad.
The secret
Write each heap's size in binary and add them without carrying: the nim-sum. Leave your opponent a nim-sum of zero and you win. In misère play the same until only heaps of one stick would remain, then leave an odd number of them.
Playing here
Click or tap a stick: it and every stick after it in the heap are taken. With the keyboard, move between the sticks with Tab and take with Enter. You can play against a bot — at the usual or the unbeatable level — or another player.