As an experiment, I want to teach an ANN to play the game of Nim.
The normal game is between two players and played with three heaps of any number of objects. The two players alternate taking any number of objects from any single one of the heaps. The goal is to be the last to take an object.
The game is easily solvable and I already wrote a small bot that can play Nim perfectly to provide data sets for supervised learning.
Now I am struggling with the design question, how should I output the solution to a specific board state. The answer always consists of two components:
- How many stones to take (a more or less arbitrary integer value)
- Which heap to take the stones from (the index of the heap)
What are available design choices in this regard and is there a state-of-the-art design for this type of problem?