The game is just like the original: a snake trying to eat an apple. The snake is colored green, and the apple is red. You are the snake; move using the arrow keys, and avoid eating your own tail.
In this version, it is possible to move through walls, although it is possible to change this by editing the
if statements starting on line 100.
The code is well commented, and only requires Python2 to be installed, however, it does use Tkinter, which should come pre-installed with Python2, but may not be for various reasons. Additional download information is below.
Use the arrow keys to move: the left arrow key to move left, the right arrow key to move right, the up arrow key to move up, and the down arrow key to move down.
Download and Play
Make sure you have Python installed. Install Python at python.org. Most computers running macOS should have Python pre-installed. Check if you have Python installed by typing the command
pythonand pressing enter in your command prompt or terminal. If a prompt like
>>>shows up, then Python is installed.
Run the following command to download and play Python Snake! Note that this will download a file called
snake.pyinto your current working directory.
curl https://xtrp.github.io/python-snake/snake.py -o snake.py && python snake.py
Bugs or Issues
If you find a bug or have an issue with Python Snake, feel free to Submit an Issue.