Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Terminal Snake Game

Description

A classic snake game implementation for the terminal using Python's curses library. Control the snake with arrow keys, eat food to grow longer, and avoid hitting the walls or your own tail!

Features

  • Arrow key controls (↑, ↓, ←, →)
  • Snake grows with each food eaten
  • Score tracking
  • Game over on collision with walls or self
  • Border display
  • Food represented with special character

Requirements

  • Python 3.x
  • curses library (pre-installed on Unix/Linux/macOS, Windows users need windows-curses)

Installation

For Windows users:

pip install windows-curses

For Unix/Linux/macOS:

No additional installation needed (curses is built-in)

Usage

python terminal_snake_game.py

How to Play

  1. Run the script
  2. Use arrow keys to control the snake direction
  3. Eat the food (π symbol) to grow and increase score
  4. Avoid hitting walls or your own body
  5. Press Ctrl+C or let the game end to exit

Game Controls

  • : Move up
  • : Move down
  • : Move left
  • : Move right
  • Ctrl+C: Quit game

Contributing

Feel free to submit issues and enhancement requests!

License

This project is part of the 100 Lines of Python Code repository.