• Kirk Steffke

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!

Recent Posts

At CRM Science, we use our Salesforce expertise to transform your enterprise. Partnering with our clients throughout the Salesforce journey, we work with leaders to strategize and optimize business processes, and design and develop solutions across every Salesforce cloud. We help you maximize the value of the Salesforce platform. 

CRM Science is a Salesforce Gold Consulting Partner and a Salesforce.org Impact Partner. Our strategic consulting services were recognized by Salesforce in four consecutive Salesforce Partner Innovation Awards, an annual recognition for partners that deliver outstanding client success. 

Connect with us
Email Us
860 First Ave, Suite 2
King of Prussia, PA 19406
(484) 775-0333
  • Twitter
  • Facebook
  • YouTube

Copyright © 2011-2021 CRM Science, Inc. All rights reserved.