The Game of Nim


    Nim is a simple two-player game that probably originated in China (although the name is thought be German, from nimm the German word for "take"). There are many variations of this game with respect to the type of counters used (stones, matches, apples, etc.), the number of counters in each row, and the number of rows in the game board.

  1. Rules

    In our variation of Nim, the game board consists of three rows of rocks. Row A contains 3 rocks, Row B contains 5 rocks, and Row C contains 8 rocks.

    The rules are as follows:



  2. What to do

  3. Sample Input/Output

    An example of the input/output for a game being played can be found here. To receive full credit for your program, your input/output format MUST EXACTLY MATCH the format in the example.


  4. Hints and Suggestions

Notes: