GitHub - lemonyte/terminal-snake: The classic Snake game, in your terminal. (original) (raw)
Terminal Snake
The classic Snake game, in your terminal.
This project was created as a demo for the Pyco library.
Installation
With uv:
uv tool install git+https://github.com/lemonyte/terminal-snake
With pip:
pip install git+https://github.com/lemonyte/terminal-snake
Requires Python 3.9 or higher.
Usage
Command line
snake [--auto] [--speed ]
The auto flag will let the snake control itself.
The speed option controls the speed of the game in updates per second. A value of 0 translates to no delay, so the game will run as fast as possible.
Controls
| Key | Description |
|---|---|
| ESC or q | Exit the game |
| SPACE | Pause the game |
| w | Move up |
| a | Move left |
| s | Move down |
| d | Move right |
When resizing the terminal, pause and unpause the game with SPACE to update the internal pixel grid accordingly.
Contributing
Contributions are welcome!
Challenge
If you have an implementation for the CPU snake player that can achieve a higher score or win the game, please do open an issue or pull request.
Removed features
The previous version of this game had a number of features that were removed due to implementation complexity. They may be added back later.
- Looping through walls
- Configurable colors
- Snake speed based on length
