Dr. Nim (aka Dr. NimPex) - Mechanical AI
In the mid-60s there was a simple board game called Dr. Nim, which is considered to be a primitive computer game. It's a simple, single player game where you play against the board. The game itself consists of just the game board and 12 marbles.
The objective is to take turns removing marbles in hopes of being the player that removes the last marble.
The game starts with 12 marbles near the top of the board. A human player starts the game by pressing a button on the board 1, 2, or 3 times, each releasing a marble from the starting reservoir. Once the human player is done, they toggle a switch at the bottom of the board which initiates the board's turn. The board now, by itself, releases 1, 2, or 3 marbles from the top. When the board's turn is done, the switch at the bottom is flipped, indicating it's the human's turn again.
This repeats until there are no more marbles at the top with your objective being to let it be your turn in which the last marble is dropped.
Video of Game Operation
Play It Here!
Just one line of code dishes out the butt-whooping and serves up h̶o̶u̶r̶s̶ seconds of endless fun:
Player 2 Algorithm
A new Lab Coat Challenge or two is in the works around this blog post. Stay tuned for links to those!