Nim is a PC based (sorry, no Apple) version of the ancient marble pile pick-up game. This is a simple bare-bones C++ console application - it runs in a DOS window as opposed to a GUI environment.
- Two play modes: Human vs. Human or Human vs. Computer.
- Variable initial marble pile size.
- Three computer mode skill level settings.
- Player statistics.
- Help file.
Two players take turns removing marbles from a pile of marbles. Each player must take at least one and at most half of the remaining marbles. The player who is left with the last remaining marble loses.
When playing against the computer, the computer can be set to play at one of three skill levels: Easy, Medium, or Difficult.
In Difficult mode, the number of marbles selected by the computer is determined by a mathematical algorithm. If the computer is allowed to make the first move while playing in Difficult mode, it will always win.
In Easy mode, the number of marbles selected by the computer is determined at random.
In Medium mode, the computer randomly switches back and forth between Difficult and Easy modes.
To view a derivation of the computer mode algorithm, download a copy of the source code.
If you have the Microsoft Visual C++ 2010 or 2008 developer software installed on your PC, just download and run the corresponding version of Nim. Nim requires no installation and does not modify the system registry.
If you don't have Visual C++ installed, then in order for Nim to run you may also need to download and install the additional C++ runtime components via a Microsoft Redistributable Package.
Nim2010.exe (31 KB)
Visual C++ 2010 Redistributable Package
Nim2008.exe (27 KB)
Visual C++ 2008 Redistributable Package
Nim was written in C++.
Nim.cpp (24 KB)