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.3.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.3-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: terminal_snake_game-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 4f5cdaf0fdcf5ebb328d0f0b1576b179fa0cb441e9df87a92af8bfce4c42beb2
MD5 7be9df07cc53ca3de82c8ebe3ce6e180
BLAKE2b-256 b9f6bbe00715921fb0912c320dafd25ba88376ed579909e5e12bf12f9f0a7895

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for terminal_snake_game-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5b476cd0f4401cd6ef98919ae584df8b6dba627fab7520d3b5d0fce8211ee074
MD5 9c8b21be3066a1fcc3de9aa427fbcf32
BLAKE2b-256 bb06dc1c837e2d73dd60da4f47020613d4198fe5370dcdf53ccc2d57887f2d95

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