Share your repls and programming experiences

← Back to all posts
Improved Nim AI
PantheraLeo04 (1)

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.

Comments
hotnewtop
[deleted]

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

PantheraLeo04 (1)

@TaylorLiang I didn't make the computer always win because I ment for this to be an experiment in machine learning. Second, I don't know any other way of doing it with this method of machine learning. Third, I don't really understand cyclomatic complexity.

[deleted]

@PantheraLeo04 the complexity is how many if/elif/else statments there are