Improved Nim AI
I made an AI that can play the game Nim. It uses a method of machine learning that I call the matchbox method, for more information on that watch this video.
NB: I do not know of any way to create some type of long term storage for the data collected by the program. As a result it will forget everything it has learned when you restart the code.
Not meaning to be rude or anything, but in order to win, you could just get make the computer take the remainder of the tokens/4. (make computer second). Furthermore, the code looks a lot like a bunch of IF and ELSE statments. Futhermore, a cyclomatic complexity of 99 is way too much. I made something like this, and it had a complexity of 1-5