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.

PyPI version 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.

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.

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.

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

๐ŸŽฏ 2048

Slide tiles on a 4ร—4 grid to combine matching numbers and reach the elusive 2048 tile! Features colorful tiles, score tracking, best score persistence within session, and the option to keep playing beyond 2048.

Key Action
โ† โ†’ โ†‘ โ†“ or WASD Slide tiles
R Restart game
C Continue playing (after reaching 2048)
Q Quit to menu

๐Ÿ“ Wordle

The viral word-guessing game in your terminal! You have 6 tries to guess a hidden 5-letter word. After each guess, letters light up green (right letter, right spot), yellow (right letter, wrong spot), or grey (not in the word). An on-screen keyboard tracks the letters you've already used.

Key Action
A-Z Type a letter (yes, including Q and R)
Enter Submit guess
Backspace Delete last letter
Esc Quit to menu
R (after round ends) New word
Q (after round ends) Quit to menu

๐Ÿชข Hangman

The classic word-guessing game with a friendly twist โ€” save the stickman by guessing letters before the gallows fills up. You have 6 wrong guesses before it's over. Hits show up green on the alphabet tracker; misses show up red.

Key Action
A-Z Guess a letter (yes, including Q and R)
Esc Quit to menu
R (after round ends) New word
Q (after round ends) Quit to menu

๐Ÿ“ฆ Installation

Quick Play (No Install)

The fastest way to play โ€” runs directly without installing anything permanently:

# Using uvx (recommended, requires uv)
uvx terminal-games

# Using pipx
pipx run terminal-games

Install with pip

pip install terminal-games
terminal-games

Install with pipx (Isolated Environment)

pipx install terminal-games
terminal-games

Install with uv

uv tool install terminal-games
terminal-games

Install from Source

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

# Run directly with uv (no install needed)
uv run terminal-games

# Or install in a virtual environment
uv sync
uv run terminal-games

Install with Homebrew ๐Ÿบ

brew tap ayu5h-raj/tap
brew install terminal-games

๐Ÿš€ Usage

After installation, simply run:

terminal-games

You can also run it as a Python module:

python -m 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
                  ๐ŸŽฏ  2048    -  Slide and merge tiles to reach 2048

              โ†‘/โ†“ 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/ayu5h-raj/terminal-games.git
cd terminal-games

# Install dependencies
uv sync

# Run the game
uv run terminal-games

# Or run as a module
uv run python -m terminal_games

Project Structure

terminal-games/
โ”œโ”€โ”€ pyproject.toml              # Project config & dependencies
โ”œโ”€โ”€ README.md                   # You're reading this!
โ”œโ”€โ”€ LICENSE                     # MIT License
โ”œโ”€โ”€ LICENSES_DATA.md            # Provenance & licenses for bundled word lists
โ”œโ”€โ”€ terminal_games/
โ”‚   โ”œโ”€โ”€ __init__.py             # Package init
โ”‚   โ”œโ”€โ”€ __main__.py             # python -m support
โ”‚   โ”œโ”€โ”€ main.py                 # Menu launcher & entry point
โ”‚   โ”œโ”€โ”€ data/                   # Bundled word lists (shipped in the wheel)
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py         # importlib.resources loaders (cached)
โ”‚   โ”‚   โ”œโ”€โ”€ words_common.txt    # ~8.3K common English words
โ”‚   โ”‚   โ””โ”€โ”€ words_5letter_valid.txt  # ~16K 5-letter words (Wordle validation)
โ”‚   โ””โ”€โ”€ games/
โ”‚       โ”œโ”€โ”€ __init__.py         # Games package
โ”‚       โ”œโ”€โ”€ tetris.py           # ๐Ÿงฑ Tetris
โ”‚       โ”œโ”€โ”€ snake.py            # ๐Ÿ Snake
โ”‚       โ”œโ”€โ”€ minesweeper.py      # ๐Ÿ’ฃ Minesweeper
โ”‚       โ”œโ”€โ”€ twenty48.py         # ๐ŸŽฏ 2048
โ”‚       โ”œโ”€โ”€ wordle.py           # ๐Ÿ“ Wordle
โ”‚       โ””โ”€โ”€ hangman.py          # ๐Ÿชข Hangman

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
  • ๐ŸŽฏ 2048
  • ๐Ÿ“ Wordle
  • ๐Ÿชข Hangman
  • ๐Ÿ“ Pong
  • ๐Ÿƒ Blackjack
  • ๐Ÿƒ 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


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.2.0.tar.gz (107.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.2.0-py3-none-any.whl (104.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: terminal_games-0.2.0.tar.gz
  • Upload date:
  • Size: 107.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for terminal_games-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f5fd463d7027642e1d951bf96485c66437d28b255b2654b621abae3665b69944
MD5 e690d00dddcc17a27a1c9ce1799338f8
BLAKE2b-256 5c5175c12b3e548f22cd42107662726c85adc26f0bba58c20f8f40f267c50ce2

See more details on using hashes here.

Provenance

The following attestation bundles were made for terminal_games-0.2.0.tar.gz:

Publisher: publish.yml on ayu5h-raj/terminal-games

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: terminal_games-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 104.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for terminal_games-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10f39df4cf16f7237f7112945179cdf58bd1db4a5755af7fdd2077b3d8bf9fd6
MD5 6880a7561272b0e1763a8feb41d4357c
BLAKE2b-256 a11f34dc48764708ced8904e6d08e4bbd4f563b73dcf312b0d20d9dde908ba7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for terminal_games-0.2.0-py3-none-any.whl:

Publisher: publish.yml on ayu5h-raj/terminal-games

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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