In Projects

Snake Game & Autopilot Algorithm

Snake is a game created with Tkinter and Python. The objective of the game is to steer the snake towards the randomly placed food while avoiding running into the walls or any part of the snake. The game gets progressively more difficult as the snake grows because free space runs a path finding and decision making algorithm that plays the game automatically without user input. The autopilot algorithm consists of several components, including a path finding algorithm and a contiguous free space finding algorithm.


Visit GitHub to download the game:
https://github.com/KevinKParsons/snake-game

  • #
    Figure 1
    Snake Game

    The blue square represents the snake's head and the green square represents the food. Gray segments represent the snake itself.

  • #
    Figure 2
    Snake Game - Running

    Running autopilot algorithm. Algorithm pathfinding mode and safety check mode are shown in the top right corner.

  • #
    Figure 3
    Snake Game & Algorithm Visuals

    Autopilot algorithm visuals are shown. The green box represents the start of the pathfinding algorithm and the red box represents the destination. The blue circles show the explored free nodes. The grey circles show the frontier nodes that have not been explored yet.

  • #
    Figure 4
    Snake Game & Algorithm Visuals - Running

    Autopilot algorithm visuals can be enabled at any point by toggling the 'Visuals' button.


Python Source - snake.py


Excel VBA Version

Similar version of the python game except it is programmed with VBA in Excel. Customized walls can be drawn and the algoirthm will avoid them.

  • #
    Figure 1
    Snake Game

    Snake game in Excel.

  • Excel File Download

    Download the snake game Excel file.