Dr. Nim (aka Dr. NimPex) - Mechanical AI

January 17, 2017


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!

Please reload

Recent Posts
Please reload

CRM Science is an award-winning, strategic Salesforce Silver Consulting Partner focused on delivering practical end-to-end solutions to financial services institutions, manufacturing companies, senior living providers, and other industries. We partner with you throughout your Salesforce journey, specializing in developing business processes, implementation across the different Salesforce clouds, and integrating third-party solutions so you can innovate faster, better engage with customers and improve your bottom line with a unified system. 

We are recognized by Salesforce and were awarded the 2016 Partner Innovation Award for Connected Ecosystem, 2017 Partner Innovation Award for Einstein Analytics, 2018 Partner Innovation Award for Lightning Leadership, and 2019 Partner Innovation Award for Community Cloud.

Ready to find the solution to your Salesforce puzzle? Contact us at info@crmscience.com! 

Partner Innovation Award 2018
Partner Innovation Award 2017
Partner Innovation Award 2016
Philadelphia 100 fastest growing companies

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