This is a project to implement different AI solutions to solve the classic snake game. All of the AI implementations are my own however the game itself is built from a tutorial by techwithtim linked below.
Here is some analysis of the algorithms
https://techwithtim.net/tutorials/game-development-with-python/snake-pygame/
git clone https://github.com/stschoberg/snakeGame.git
The game has various runmodes
- keys - the user plays the game with the arrowkeys
- random - the ai chooses a random path with no respect for the snack
- shortest - the ai chooses the shortest path to the snack
- better-shortest - the ai chooses the shortest path to the path but will avoid its own body
- hamiltonian - guarenteed to win. takes a while
python3 playSnakeGame.py --option # where option is a mode listed above