Skip to main content

A collection of classic mini games you can play right in your terminal ๐ŸŽฎ

Project description

๐ŸŽฎ Terminal Games

A collection of classic mini games you can play right in your terminal! Built with Python and the blessed library for a smooth, colorful terminal UI experience.

Python License Platform


๐Ÿ•น๏ธ Games Included

๐Ÿงฑ Tetris

The classic falling blocks puzzle game! Arrange tetrominoes to complete lines and score points. Features ghost pieces, next piece preview, NES-style scoring, and increasing difficulty.

Controls:

Key Action
โ† โ†’ or A/D Move piece left/right
โ†‘ or W Rotate piece
โ†“ or S Soft drop
Space Hard drop
P Pause
Q Quit to menu

๐Ÿ Snake

Navigate the snake to eat food and grow longer โ€” but don't run into the walls or yourself! Features bonus food, speed progression, and a gradient snake body.

Controls:

Key Action
โ† โ†’ โ†‘ โ†“ or WASD Change direction
P Pause
Q Quit to menu

๐Ÿ’ฃ Minesweeper

The timeless puzzle of logic and deduction. Uncover cells without detonating any mines! Features three difficulty levels, flagging, chording, and flood-fill reveal.

Controls:

Key Action
โ† โ†’ โ†‘ โ†“ or WASD Move cursor
Space / Enter Reveal cell (or chord)
F Flag / unflag cell
C Chord (auto-reveal neighbors)
R Restart / new game
Q Quit to menu

๐Ÿ“ฆ Installation

Using uv (Recommended)

# Clone the repository
git clone https://github.com/yourusername/terminal-games.git
cd terminal-games

# Install and run with uv
uv run terminal-games

Using pip

pip install terminal-games

Using pipx (Isolated Install)

pipx install terminal-games

From Source

# Clone the repository
git clone https://github.com/yourusername/terminal-games.git
cd terminal-games

# Create a virtual environment and install
uv sync
uv run terminal-games

๐Ÿš€ Usage

After installation, simply run:

terminal-games

You'll be greeted with a beautiful menu where you can select any game using the arrow keys and Enter.

 ______                    _             __   _____
/_  __/__  _________ ___  (_)___  ____ _/ /  / ___/____ _____ ___  ___  _____
 / / / _ \/ ___/ __ `__ \/ / __ \/ __ `/ /  / /  _ / __ `/ __ `__ \/ _ \/ ___/
/ / /  __/ /  / / / / / / / / / / /_/ / /  / /_/ / /_/ / / / / / /  __(__  )
/_/  \___/_/  /_/ /_/ /_/_/_/ /_/\__,_/_/   \____/\__,_/_/ /_/ /_/\___/____/

                ๐ŸŽฎ  Classic Mini Games for your Terminal  ๐ŸŽฎ

                โ–ธ ๐Ÿงฑ  Tetris  -  Arrange falling blocks to clear lines
                  ๐Ÿ  Snake   -  Eat food, grow longer, don't hit yourself
                  ๐Ÿ’ฃ  Minesweeper  -  Uncover tiles without hitting mines

              โ†‘/โ†“ Navigate  โ€ข  Enter Select  โ€ข  q Quit

๐Ÿ› ๏ธ Development

Prerequisites

  • Python 3.12+
  • uv (recommended) or pip

Setting Up the Dev Environment

# Clone the repo
git clone https://github.com/yourusername/terminal-games.git
cd terminal-games

# Install dependencies with uv
uv sync

# Run the game
uv run terminal-games

# Or run directly
uv run python -m terminal_games.main

Project Structure

terminal-games/
โ”œโ”€โ”€ pyproject.toml              # Project config & dependencies
โ”œโ”€โ”€ README.md                   # You're reading this!
โ”œโ”€โ”€ terminal_games/
โ”‚   โ”œโ”€โ”€ __init__.py             # Package init
โ”‚   โ”œโ”€โ”€ main.py                 # Menu launcher & entry point
โ”‚   โ””โ”€โ”€ games/
โ”‚       โ”œโ”€โ”€ __init__.py         # Games package
โ”‚       โ”œโ”€โ”€ tetris.py           # ๐Ÿงฑ Tetris
โ”‚       โ”œโ”€โ”€ snake.py            # ๐Ÿ Snake
โ”‚       โ””โ”€โ”€ minesweeper.py      # ๐Ÿ’ฃ Minesweeper

Adding a New Game

  1. Create a new file in terminal_games/games/ (e.g., pong.py)
  2. Implement a play_pong(term: Terminal) -> None function
  3. Add it to the GAMES list in terminal_games/main.py
  4. That's it! The menu will pick it up automatically.

๐Ÿ—บ๏ธ Roadmap

  • ๐Ÿงฑ Tetris
  • ๐Ÿ Snake
  • ๐Ÿ’ฃ Minesweeper
  • ๐Ÿ“ Pong
  • ๐Ÿƒ Blackjack
  • ๐ŸŽฏ 2048
  • ๐Ÿ”ค Hangman
  • ๐Ÿƒ Flappy Bird
  • ๐Ÿš€ Space Invaders
  • ๐Ÿฐ Text Adventure
  • ๐Ÿ† Global high scores
  • ๐ŸŽจ Custom themes
  • ๐Ÿ“ฆ Homebrew formula

๐Ÿ“‹ Requirements

  • Terminal size: At least 80ร—24 (standard terminal size). Larger terminals provide a better experience.
  • Python: 3.12 or newer
  • OS: macOS, Linux, or Windows (Windows Terminal recommended)
  • Dependencies: blessed (installed automatically)

๐Ÿค Contributing

Contributions are welcome! Whether it's a new game, bug fix, or UI improvement:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/new-game)
  3. Commit your changes (git commit -m 'Add awesome new game')
  4. Push to the branch (git push origin feature/new-game)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.


๐Ÿ’– Acknowledgments

  • Built with blessed โ€” a thin, practical wrapper around terminal capabilities
  • Inspired by the classic games we all grew up playing
  • Managed with uv โ€” an extremely fast Python package manager

Made with โค๏ธ and Python ๐Ÿ
Happy Gaming! ๐ŸŽฎ

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_games-0.1.0.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

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

terminal_games-0.1.0-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file terminal_games-0.1.0.tar.gz.

File metadata

  • Download URL: terminal_games-0.1.0.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for terminal_games-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8a26b846e1d511e40d33184c18fa4a0fdf7c4b4da7ca77ac7ba0a3d5ce056452
MD5 a1d9c6dadf9c8cc10784be12c1601de4
BLAKE2b-256 cf6f2407e6d7810f36d9f3c5f0f578b2dbc4e899ab904ddc6d136a370647c001

See more details on using hashes here.

File details

Details for the file terminal_games-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: terminal_games-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for terminal_games-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d8be6a01c2af0b413e4926e66f79cc4f43609a134d29dc02d295e523da29d6f
MD5 42b0cee1385a38f5421dd0e930649a47
BLAKE2b-256 13ec89efeb9c5ff9feced0db55211a10cbf00189628dbd93780875fedbcdd6de

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