Skip to content
This repository has been archived by the owner on Sep 6, 2020. It is now read-only.
/ snakepy Public archive

Classic snake game implemented using pygame and Reinforcement learning

License

Notifications You must be signed in to change notification settings

satwikkansal/snakepy

Repository files navigation

snakepy

AI powered classic snake game implemented using pygame and Reinforcement learning. You may also like my Self Driving Car simulation project developed on similar lines.

Usage

python snake.py

Configurations

To configure the game accoring to you, open the snake.py and change the constants defined at the top. #TODO: Add CLI arguments support

How it works?

As of now, it uses Q-learning algorithm to decide the next move and it really gets smart after few iterations of trainiing.

Current Status

GIF output

PS: The rule of "snake-biting itself and getting killed" was disabled while taking this screencast.

Next Steps

  • Add Length of the sanke to state
  • Apply state space optimizations to reduce the state space.
  • Implement SARSA and compare results.
  • Integrate Deep Q-Learning and compare results.

About

Classic snake game implemented using pygame and Reinforcement learning

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages