Anyone who understands this code is crazy. Press the ball to start Its an RL for the game "Take-Away" it starts with 12 Matches. Last one to take one loses. The AI takes 1, 2 or 3 of them Remembers what it took. so does the second AI. Successful moves are rewarded; bad ones are punished. After thousands of games, it keeps getting better. and that keeps happening over and over again the best strat is to take (n−1)mod4. often it learns that.
did it by myself. if you find bugs. pls report them in the comments.