At first glance, Nim seems as simple as tic-tac-toe, and can be played almost as quickly. In fact, the game is much more subtle and difficult. The play involves two players alternately taking away items from five piles containing one, two, three, four and five objects. The player who takes the last piece wins.
On a turn, a player must choose one pile from which to take pieces. He or she can take any number of pieces from that pile, but must take at least one piece. The key is to keep in mind how many pieces are in each pile, what your opponent's options are, and what the number in each pile might be several moves ahead. For example, you have to prevent your opponent from leaving you with only two piles with one piece in each. Planning and calculating are essential.
The name of this game comes from the German word for "take," and games similar to Nim have existed for centuries. A Harvard mathematician "solved" the game in 1901, calculating a perfect winning strategy using a binary number system. Even the earliest computers were able to play the game. It's claimed that a 1942 invention for playing Nim may be the oldest electronic game in existence.
Usually the game is played with five piles. You can use matches, coins or just marks on a piece of paper. Playing with different number of piles is also possible. And you can switch the whole game around so that the person who takes the last piece loses.
It sounds simple, but Nim strategy is very tricky. You'll find your head spinning with numbers as you try to take, and leave, the right number of items. There is no easy formula to guide you, just your feel for the game.