Skip to content
/ snek Public

It's snake. But snek. And in Python.

License

Notifications You must be signed in to change notification settings

skifli/snek

Repository files navigation

snek

Lines of Code

Cover

It's snake. But snek. In Python. It supports all OSes that Python can run on, and was designed to look like a retro game from the early 80s. It runs entirely in your terminal, no GUI libraries required. It is written in just over 200 lines of code, and if you remove the fancy formatting while maintaining readability it would be around 150 lines of code.

The world width and height is automatically set to the maximum it can be for the size of terminal it is running in, so please don't make the terminal size smaller while playing. Currently the only ways to die are by hitting the world borders, or hitting the snake's body, in which case the score (but not high score), will reset.

Installation

Note

Please make sure you have support for Unicode fonts enabled in your system's settings. If you don't, the game will not look as it should.

Running from source

  • Make sure you have Python installed and is in your system environment variables as python. If you do not have Python installed, you can install it from here.
  • Download and extract the repository from here. Alternatively, you can clone the repository with Git by running git clone https://github.com/skifli/snek in a terminal.
  • Navigate into the root directory of your clone of this repository.
  • Run the command python -m pip install -r requirements.txt.

Usage

  • Run the command python snek.py in the root of your clone of this repository.

Known Bugs

Please see bugs.md.