Skip to content

Armando024/Snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neural Network used to play classic Snake game

Libraries:

Please installed to compile, for instructions on how to install used the provided links.
Numpy:
https://www.scipy.org/scipylib/download.html
TensorFlow:
https://www.tensorflow.org/install/
Pygame:
https://www.pygame.org/wiki/GettingStarted

To execute:

In Mac OS/Linux, running the the instruction below in your terminal does the trick. 
    python3 main.py

The data used to train the Neural Network:

Inputs:
    Using the head of the snake as the main reference point to calculate if there were obstacles 
    in front of the snake or sides.
        If one was there there was an obstacle in front.
        If zero there was no obstacle.
        
    The orientation of the snake head to the apple like a compass.
        Calculated the angle between the snake and head
    
    |  a    -apple
    | /
    |/
    O   -head
    o   -body
    o
    o
    o

Example gif

About

{Machine Learning} Deep Neural Network playing the classic Snake game

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages