Nim
Nim
My solution for the Nim project of the CS50AI course.
🪧 Vitrine.Dev | |
---|---|
✨ Nome | Nim |
🏷️ Tecnologias | Python |
About the project
CS50AI exercise link: https://cs50.harvard.edu/ai/2020/projects/4/nim/
The play.py file and the signature of the functions of the nim.py file were already created by the CS50AI staff, so my task as a student was to create an AI capable of playing the Nim game. Using the method of reinforcement learning, making the AI play against itself 10000 times.
Rules of the game
In the Nim game, you have 4 piles with sticks:
- Pile 0: 1 stick
- Pile 1: 3 sticks
- Pile 2: 5 sticks
- Pile 3: 7 sticks
The two players have to remove a certain number of sticks from one pile every turn, the player to remove the last stick will be the loser.
Try it yourself
To run the game yourself, just run the following commands:
git clone https://github.com/BrenoMorim/nim.git nim
cd nim
python play.py
Veja meu projeto em: https://github.com/BrenoMorim/nim