Skip to content
/ snake-ai Public

Python Snake game with neural network (NEAT) AI

Notifications You must be signed in to change notification settings

sycu/snake-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake AI

Python Snake game with neural network (NEAT) AI

Dependencies

pip install -r requirements.txt

Usage

Start learning from scratch

python snake.py

or use previously saved population

python snake.py population.dat

Press space to toggle fast mode - speed will be reduced to 10 fps and you will see network outputs in the console.

After exceeding fitness threshold (fitness_threshold in config.txt) the population is saved in population.dat file.

You can comment out redraw function (line 196) to speed up learning process.

If you want to play the game by yourself, just comment out line 182 and uncomment lines 128-131 and 185-186.

About

Python Snake game with neural network (NEAT) AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages