Background music

Background music pauses in this window. Click a track to hear a preview.

Choose music
12%

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?

Grokipedia

Goal

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.

The heaps 3, 4 and 5 have a nim-sum of 2. Taking 2 from the heap of 3 leaves 1, 4 and 5 — a nim-sum of zero, a lost position for the opponent.
The heaps 3, 4 and 5 have a nim-sum of 2. Taking 2 from the heap of 3 leaves 1, 4 and 5 — a nim-sum of zero, a lost position for the opponent.

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.

Play now

Invite friends

Send the link to friends and arrange a game together.

WhatsApp