Skip to content

Repository files navigation

Snake-AI

This is an university-project by Can Berkil and Andreas Dichter. The goal was to train a genetic algorithm to play the classic snake game.

Manual

  • to execute the code run 'train_ga.py'
  • in here you can edit the number of generations you want to train (variable: 'num_generations')
  • the programm will train for this number of generations in high speed and will from there on continue training in normal speed for another 10 generation so you can watch closely how it performs

Result

We found that training for 150 generations gave us the best results. This is also the number of generations that is entered in the code.

The following video is a short exerpt of the algorithm playing the game:

snake_ai.mp4

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages