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.
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
- 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
- ๐ 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:
- 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
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.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a26b846e1d511e40d33184c18fa4a0fdf7c4b4da7ca77ac7ba0a3d5ce056452
|
|
| MD5 |
a1d9c6dadf9c8cc10784be12c1601de4
|
|
| BLAKE2b-256 |
cf6f2407e6d7810f36d9f3c5f0f578b2dbc4e899ab904ddc6d136a370647c001
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d8be6a01c2af0b413e4926e66f79cc4f43609a134d29dc02d295e523da29d6f
|
|
| MD5 |
42b0cee1385a38f5421dd0e930649a47
|
|
| BLAKE2b-256 |
13ec89efeb9c5ff9feced0db55211a10cbf00189628dbd93780875fedbcdd6de
|