For my Christmas gift to young people next year (2020), I plan to put together a Play Nim game package.  The Box will be one that I produce with my new laser cutting skills.  The instructions and explanation will be the following:

PlayNIM

Since High School days I’ve had a fascination with the game of NIM.  I’ve tried on several occasions to write a program to play the ‘perfect game’, but for one reason or another didn’t make it.

Recently I was having fun with a Arduino MEGA 2560 microcontroller.  I started with a UNO board but quickly found that it didn’t have enough inputs for my needs.  The MEGA has 54 digital inputs and 16 analogs, that should hold me for awhile.

Now I’ve done it!  Here is a picture of the hardware side of the solution:

PlayNIM

The software side is harder to show, but it works!  Sorry, but this is all I have to show:

NimCode1

NimCode2

NimCode3

NimCode4

NimCode5

NimCode6

NimCode7