Skip to main content

A colorful terminal-based Snake game with score tracking

Project description

Snake Game

A classic Snake game implemented in Python using the curses library. This terminal-based game features colorful graphics, score tracking, and an intuitive interface.

Demo

Snake Game Demo

Features

  • Colorful terminal-based UI
  • Score and high score tracking
  • Direction-aware snake appearance
  • Game over screen with restart option
  • Persistent high score storage

Requirements

  • Python 3.6 or higher
  • curses library (included in standard Python distribution)

Installation & Running

There are two ways to install and run the game:

Method 1: Using pip (Recommended)

  1. Install the package:

    pip install terminal-snake-game
    
  2. Run the game:

    # Either use the command-line tool
    snake-game
    
    # Or run as a Python module
    python3 -m snake_game
    

Method 2: From Source

  1. Clone the repository:

    git clone git@github.com:SwetaTanwar/snake-game.git
    cd snake-game
    
  2. Run the game:

    # Using Python directly
    python3 snake_game.py
    

    Or make it executable first:

    # Make the script executable
    chmod +x snake_game.py
    
    # Then run directly
    ./snake_game.py
    

How to Play

Controls

  • Use arrow keys (↑ ↓ ← →) to control the snake
  • Eat ★ to grow and score points
  • Press 'q' to quit
  • Press 'r' to restart after game over

Game Elements

  • 🐍 Snake head shows direction (▶ ◀ ▲ ▼)
  • ◆ Snake body
  • ★ Food
  • Score and high score display at the top
  • Control instructions at the bottom

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

terminal_snake_game-1.0.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terminal_snake_game-1.0.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file terminal_snake_game-1.0.0.tar.gz.

File metadata

  • Download URL: terminal_snake_game-1.0.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for terminal_snake_game-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3c6fb1760d7a6785d437c15c69bb3248de9d7ab48cfc0e82ee3680b5d3e030e0
MD5 0974a74824930a9baf88bda2bfc884d4
BLAKE2b-256 8d2d47c8acd49295813b109c8603d801d24e7d3bdad2f1d842998d8af9a188eb

See more details on using hashes here.

File details

Details for the file terminal_snake_game-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for terminal_snake_game-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f79068ee4d8464c013f32f422b442da87e22cdf5b7d11df1611b9b952d1528ba
MD5 93915c6a4a8860af7ee724a3e41d5c50
BLAKE2b-256 963674e6814fe3425d3f64136537de2742254c2db822c8fe0ebe87de4a29d517

See more details on using hashes here.

Supported by

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