ikbendewilliam / AIPlaysSnake

This is the source code I made for a medium article and a YouTube video. I will add links to both if/when I make them.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AI learns to play Snake

This is the source code I made for a medium article and a YouTube video.

Files

model.py

A class that implements RL. The idea is that we can plug it in to different situations and can quickly create a model for it.

game.py

A class that contains all functions to play and train on the classic Snake game.

training.py/training.ipynb

This is were the training is done. This combines both game and model.

snake_game.py

A graphic representation of the snake game. You can either play yourself or have a trained model play for you (manual variable)

ipynb file

To open the ipynb file, you can use jupyter notebook or Visual Studio Code with the Jupyter extension.

Note that the training.py is almost identical to the training.ipynb file so you can also use that one instead.

About

This is the source code I made for a medium article and a YouTube video. I will add links to both if/when I make them.

License:GNU General Public License v3.0


Languages

Language:Jupyter Notebook 98.8%Language:Python 1.2%