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.
๐น๏ธ 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
- Create a new file in
terminal_games/games/(e.g.,pong.py) - Implement a
play_pong(term: Terminal) -> Nonefunction - Add it to the
GAMESlist interminal_games/main.py - 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:
- Fork the repository
- Create your feature branch (
git checkout -b feature/new-game) - Commit your changes (
git commit -m 'Add awesome new game') - Push to the branch (
git push origin feature/new-game) - 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
- Word lists bundled from
first20hours/google-10000-english(MIT) anddwyl/english-words(Unlicense). See LICENSES_DATA.md for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3af12b94b4463a959273ff4d1520db6ad770b8f704101e0443878d6c26b7c30f
|
|
| MD5 |
c3dd66f06a663b827b174b44ad5dce78
|
|
| BLAKE2b-256 |
97a4f1e1fd6bf1d6bc0d0a47e9f385e314f1b87deec7b47eb3ec832521177ba3
|
Provenance
The following attestation bundles were made for terminal_games-0.3.0.tar.gz:
Publisher:
publish.yml on ayu5h-raj/terminal-games
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
terminal_games-0.3.0.tar.gz -
Subject digest:
3af12b94b4463a959273ff4d1520db6ad770b8f704101e0443878d6c26b7c30f - Sigstore transparency entry: 1421649308
- Sigstore integration time:
-
Permalink:
ayu5h-raj/terminal-games@8dae5e439c87c2fe17ec06dce158fe78dc715833 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/ayu5h-raj
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8dae5e439c87c2fe17ec06dce158fe78dc715833 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4db5117e0de12e4384149f363991f90ca31caca249b16b0fcecbceecf5812693
|
|
| MD5 |
3a3e01200ecae82cb7ad67b92b54b408
|
|
| BLAKE2b-256 |
cef38105b463ff98256859d952610b43c2104a1d1e176f535a22d5eba371ecf6
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
terminal_games-0.3.0-py3-none-any.whl -
Subject digest:
4db5117e0de12e4384149f363991f90ca31caca249b16b0fcecbceecf5812693 - Sigstore transparency entry: 1421649408
- Sigstore integration time:
-
Permalink:
ayu5h-raj/terminal-games@8dae5e439c87c2fe17ec06dce158fe78dc715833 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/ayu5h-raj
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8dae5e439c87c2fe17ec06dce158fe78dc715833 -
Trigger Event:
push
-
Statement type: