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. The answer pool and valid-guess list are derived from the original (pre-NYT) MIT-licensed Wordle source.

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

๐Ÿ“… Wordle Daily

One puzzle per day โ€” same word for every player, deterministic by date. Quit mid-puzzle and your progress resumes when you come back. Once you solve (or use all 6 guesses), you're locked out until tomorrow's puzzle. Saved state lives at ~/.terminal_games/wordle_daily.json.

Key Action
A-Z Type a letter
Enter Submit guess
Backspace Delete last letter
Esc / Q Quit to menu (resume on next launch)

๐Ÿชข 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
โ”‚   โ”‚   โ”œโ”€โ”€ words_wordle_answers.txt # ~2.3K curated Wordle answers
โ”‚   โ”‚   โ””โ”€โ”€ words_wordle_valid.txt   # ~13K original-Wordle valid guesses
โ”‚   โ””โ”€โ”€ games/
โ”‚       โ”œโ”€โ”€ __init__.py         # Games package
โ”‚       โ”œโ”€โ”€ tetris.py           # ๐Ÿงฑ Tetris
โ”‚       โ”œโ”€โ”€ snake.py            # ๐Ÿ Snake
โ”‚       โ”œโ”€โ”€ minesweeper.py      # ๐Ÿ’ฃ Minesweeper
โ”‚       โ”œโ”€โ”€ twenty48.py         # ๐ŸŽฏ 2048
โ”‚       โ”œโ”€โ”€ wordle.py           # ๐Ÿ“ Wordle (random + daily mode)
โ”‚       โ””โ”€โ”€ hangman.py          # ๐Ÿชข Hangman
โ”œโ”€โ”€ scripts/
โ”‚   โ””โ”€โ”€ build_wordle_answers.py # Regenerates the Wordle word lists

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
  • ๐Ÿ“… Wordle Daily
  • ๐Ÿชข 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.3.0.tar.gz (149.9 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.3.0-py3-none-any.whl (148.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: terminal_games-0.3.0.tar.gz
  • Upload date:
  • Size: 149.9 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.3.0.tar.gz
Algorithm Hash digest
SHA256 3af12b94b4463a959273ff4d1520db6ad770b8f704101e0443878d6c26b7c30f
MD5 c3dd66f06a663b827b174b44ad5dce78
BLAKE2b-256 97a4f1e1fd6bf1d6bc0d0a47e9f385e314f1b87deec7b47eb3ec832521177ba3

See more details on using hashes here.

Provenance

The following attestation bundles were made for terminal_games-0.3.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: terminal_games-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 148.4 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4db5117e0de12e4384149f363991f90ca31caca249b16b0fcecbceecf5812693
MD5 3a3e01200ecae82cb7ad67b92b54b408
BLAKE2b-256 cef38105b463ff98256859d952610b43c2104a1d1e176f535a22d5eba371ecf6

See more details on using hashes here.

Provenance

The following attestation bundles were made for terminal_games-0.3.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