This program uses an evolutionary algorithm to create a neural network that can play the snake game. After the user stops the evolution process, the best snake is rendered. Smark snake uses p5 for Python to render the snake, and NumPy for calculations.
For best results, wait until the average score is at least above 0 (usually 3-8 generations).
- Make sure you have python installed
- Clone the repository
git clone https://github.com/Ashwagandhae/smart-snake
cd smart-snake
- Next, install the packages...
You can install from requirements.txt:
pip install -r requirements.txt
Or, just install manually (there's only 1 package):
pip install numpy
- Finally, run the program
python3 main.py