The game of nimm, nimb or nim (I am not sure of the correct name in English) is a game usually played with match sticks or pebles as a seemingly equalitarian strategy game between two players. The players take turns in chosing a heap and taking at least one item out of the game. There are no unknowns such as dice throws or shuffled card decks.
In addition, there are only a fixed and limited number of items, a limited set of possible final moves, and only one of two outcomes; you win or you lose.
It is therefore possible for players with some experience to memorize all possible steps from start to finish, and win without effort in practically every match.
Yet, almost everyone is deeply disturbed as they try the game up against an expert player. They notice a big mismatch between the extreemely equalitarian and fair rules for the game, and the complete supremacy that the opposition enjoys.
The mathematical logic needed in order to check the safeness of a position involves an Exclusive or (XOR) operation between the binary representations of numbers of game assets in remaining heaps. It is therefore very difficult to apply or think procedurally about the move during the quick pace in which the game is usually played at.
Luckily, it takes a few dozen games to start noticing the winning patterns.
It can be a very entertaining activity during the initial period of surprise, amazement and incredulous requests to play again and again. It can also serve as a good illustration of the necessity of knowledge and mastery when failure must not be risked, however remote the probability of loss may seem initially.
It is easy to see that the nim game is much more like an illusionists trick, and much less like a game of "Go" or a game of "Chess".
You can also play it offline after the page is loaded, or if you save this page and its logic (index.htm, nim.js, item.gif and index_noscript.htm) on local storage, you may load it from there when offline.