Skip to content

Nim

Take from one heap, as many as you like. Last counter wins, or loses in misère.

Loading game…

How to play

  1. Several heaps of counters. On your turn take one or more counters from a single heap.
  2. Normal play: whoever takes the last counter wins. Misère: whoever takes the last counter loses.
  3. Every starting position gives the first player a winning plan; finding it is the game.
  4. Choose 3, 4 or 5 heaps. Hard plays perfectly; normal slips now and then; easy plays at random.

About Nim

Play Nim free online against the computer: three to five heaps, take any number from one heap, normal or misère rules, a computer that plays perfectly on hard, and hints that teach the nim-sum.

Nim: common 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.
What is the nim-sum?
Write each heap size in binary and add the columns without carrying (exclusive-or). 3 ⊕ 4 ⊕ 5 = 011 ⊕ 100 ⊕ 101 = 010 = 2. A position with nim-sum zero is lost for the player to move.
  • Hare and Hounds2 playersThree hounds that can't turn back against one hare that can. Trap it or slip past.Board GamesPlay
  • Connect62 playersTwo stones a turn, six in a row to win. Fairer than Gomoku, twice as sharp.Board GamesPlay
  • Sim2 playersSix dots, fifteen lines, two colours. Close a triangle of your own colour and you lose.Board GamesPlay
  • Royal Game of Ur2 playersThe 4,500-year-old race game: four dice, rosettes, captures on the shared lane.Board GamesPlay
  • Order and Chaos2 playersBoth players place X or O. Order wants five in a row of either; Chaos wants a full board without one.Board GamesPlay
  • Ultimate Tic-Tac-Toe2 playersNine boards in one. Your move decides where your opponent plays next.Board GamesPlay

More Board Games →