NIM

NIM is the classic example of a combintarial game. The rules are very simple, on your turn you may remove as many dots as you want from any one row. Clicking on a dot here will remove that dot as well as all others to its immediate right. Whoever takes the last spot wins. If you are using internet explorer and can't see the game, you might need to allow active content by clicking the info bar at the top of the screen.

Since the same moves are available to either player at all times, NIM is an example (in fact, the example) of an impartial combinatorial game. All positions in this game are either valued 0 (2nd player wins) or have some other nimber value. A single pile of height n (here a row of size n) has nim-value *n. The key in playing the game is to always move so as to leave a position of value 0. In order to do that you must know how to add nimbers. Nimbers add by using bitwise-exclusive-or on their binary representations. Another way to put this is that you rewrite each length as a sum of powers of two and then cancel nimbers that occur in pairs. If you'd rather just have a hint, press the 'h' key, and any winning moves will be revealed.

You can also use the number keys 3, 4, 5, and 6 to begin a new game with the given number of rows. If any of the key commands don't work, click somewhere on the applet where there are no spots and try again.