Play Nim Online
Also known as: Marienbad
Take one or more stones from a single heap; whoever takes the last stone wins. The classic game solved with binary arithmetic.
How to Play Nim
Objective
Take the last stone.
Rules
The board has five heaps of shared grey stones; the starting heaps are random. Red starts. On your turn, take one or more stones from one heap: tap a stone to take it together with every stone to its right in that row. Whoever takes the last stone wins.
History of Nim
A complete mathematical theory
Games of taking objects from piles are ancient, but Nim got its name and its complete solution from Charles L. Bouton, who published “Nim, a game with a complete mathematical theory” in 1901. He proved that the binary exclusive or of the heap sizes decides the game; the name may come from the German nimm, “take!”.
In 1951 the Nimrod computer, built by Ferranti for the Festival of Britain, played Nim against visitors, one of the first machines built to play a game. A misère version (whoever takes the last stone loses) with rows of 1, 3, 5 and 7 appears in the 1961 film Last Year at Marienbad, so it is often called Marienbad.
The heart of impartial games
In the 1930s Roland Sprague and Patrick Grundy independently showed that every impartial game (both players have the same moves, and whoever cannot move loses) is equivalent to a single Nim heap. That is why Wythoff, Northcott’s Game, Kayles and Chomp in this section can all be analysed like Nim.
Nim is not a connection game and does not appear in Cameron Browne’s book.