Skip to main content

Command-line version of the classic Snake game.

Project description

Snake

Build Status PyPI ruben-snake-cmd GitHub

Command-line version of the classic Snake game.

GIF showing gameplay

Installation

Install as usual:

pip install ruben-snake-cmd

You may wish to create a virtual environment beforehand.

Installation on Windows

The game requires the curses library. This should already be installed on Linux and macOS so no additional steps are required. However, it is not included in the Windows version of Python, as noted in the curses documentation. On Windows, you can install the windows-curses package (see this comment), using pip install windows-curses.

Usage

Run the game using the following command:

ruben-snake-cmd

Note that I've only tested this on Linux.

The application should generally be self-explanatory.

One thing to note is the settings screen, reached by pressing S on the title screen. Currently, the only option is to enable/disable the snake wrapping around the edge of the window by pressing B. If disabled, the snake will "die" on reaching the edge of the window.

There is also a controls screen, reached by pressing C on the title screen.

In-Game Controls

Key(s) Action
, , , Change direction
Q End game

Note that these only apply in-game and not on other screens, such as the title screen or settings screen.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ruben-snake-cmd-0.3.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

ruben_snake_cmd-0.3.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file ruben-snake-cmd-0.3.0.tar.gz.

File metadata

  • Download URL: ruben-snake-cmd-0.3.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for ruben-snake-cmd-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0603680800ce096cde56be118b3d360c75b18e953b8047d687c73b548725f247
MD5 7a33bacc434829133054c3aadfa9c6d7
BLAKE2b-256 2112e89b20b1b6a5eac367110b662b0b05da48553b9893550c6ae0dbd71bbdf1

See more details on using hashes here.

File details

Details for the file ruben_snake_cmd-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ruben_snake_cmd-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5c6bdef270563fffb778bb39d7f8c9b68eb53c5c8620c08c61e6815ea16d76e
MD5 05f2646ca968f65e804527624a5a940b
BLAKE2b-256 0d0367e9baa7fd3ad1e5b60854d048f8c82a503df2611ef2aa17f4872985e032

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page