Skip to content

All snake game algorithms that I have created. (Including refactored and original code) Python Turtle was used to visualize the project.

Notifications You must be signed in to change notification settings

taaha-khan/snake-game-algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 

Repository files navigation

snake-game-algorithm

An Algorithm that plays a perfect game of Snake. (Python Turtle)

ALGORITHMS: --------------------------------------

HAMILTONIAN CYCLE: A Hamiltonian Cycle is generated by creating a Minimum Spanning Tree using the Prim method. This tree is used as a maze for a runner to travel through by going in a priority order of left, straight, and right. This traversing maneuver leads the history of the runner to become a Hamiltonian cycle through every node on the grid.

SHORTCUT ALGORITHM: The Hamiltonain Cycle is used as a base for a snake to travel on. The snake loosely follows the order of the cycle, but is allowed to take shortcuts through the cycle. This leads the snake to travel to the food faster than just plainly following the Hamiltonian Cycle. The algorithm is an implementation of an algorithm written by John Tapsell, who was the first to invent this sort of pertubated Hamiltonain Cycle.

About

All snake game algorithms that I have created. (Including refactored and original code) Python Turtle was used to visualize the project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages