Skip to content

Ashwagandhae/smart-snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart snake

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).

Usage

  1. Make sure you have python installed
  2. Clone the repository
git clone https://github.com/Ashwagandhae/smart-snake
cd smart-snake
  1. 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
  1. Finally, run the program
python3 main.py

Releases

No releases published

Packages

No packages published

Languages