Skip to main content

snake-game-cli

Play snake game in your terminal.

demo

Installation

pip install snake-game-cli

Usage

play-snake                 # start at Normal difficulty
play-snake -d hard         # or easy / normal / hard

You can also pick the difficulty on the start screen with ← / →, then press Enter to begin.

Controls

Key Action
↑ / W Move up
↓ / S Move down
← / A Move left
→ / D Move right
P Pause / Resume
Q Quit

On the start screen, ← / → change the difficulty and Enter starts the game.

Features

  • Three difficulty presets (easy / normal / hard), selectable via -d or on the start screen
  • Restarting after game over returns to the difficulty selector, so you can switch presets between runs
  • Snake speeds up as your score increases
  • High score persists across sessions
  • Pressing a direction key triggers an immediate move
  • Terminal resize is handled gracefully

Development

Checks run automatically before every git push via a tracked pre-push hook. Enable it once after cloning:

git config core.hooksPath .githooks

The hook runs the same checks on your local Python and blocks the push if any fail:

ruff check .
ruff format --check .
mypy snake_game_cli.py
pytest

Bypass it in an emergency with git push --no-verify.

On release (pushing a v* tag), GitHub Actions runs the test suite across Python 3.10–3.13 and only publishes to PyPI if every version passes.

Metadata

Release files for snake-game-cli 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for snake-game-cli 0.3.1
File Size Uploaded Provenance Actions
snake_game_cli-0.3.1.tar.gz 13.2 kB Without provenance Details for snake_game_cli-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for snake-game-cli 0.3.1
File Interpreter ABI Platform Actions
snake_game_cli-0.3.1-py3-none-any.whl Python 3 none any Details for snake_game_cli-0.3.1-py3-none-any.whl

Total release size: 21.6 kB

Release files / snake_game_cli-0.3.1.tar.gz

Download URL snake_game_cli-0.3.1.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1e86e1aa2c39c1458bb314ed5a40c36ea713b820e43272c923ee4107d59ac26d
BLAKE2b-256 checksum
How to use checksums
88b1c79ea0edd9c76a92f4184476ab7a51c37259eeceac035d7c55410e946929
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / snake_game_cli-0.3.1-py3-none-any.whl

Download URL snake_game_cli-0.3.1-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0dcdfdfa1b997dc4c35685d53d1071a795356b748005901225b075572e6357bd
BLAKE2b-256 checksum
How to use checksums
0bdeec1202aa0c491919707539642ab4c97bf50fbe5a857f2304685f10f85723
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for snake-game-cli 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page