2048 TUI Game
A terminal-based implementation of the classic 2048 puzzle game using Python and curses.
Installation
From PyPI (recommended)
pip install tui-2048
From source
git clone https://github.com/yourusername/tui-2048.git
cd tui-2048
pip install .
Development install
pip install -e .
Usage
After installation, run the game with:
tui-2048
Or alternatively:
2048
Or run directly with Python:
python -m game2048.cli
Controls
| Key | Action |
|---|---|
| ↑ / W | Move tiles up |
| ↓ / S | Move tiles down |
| ← / A | Move tiles left |
| → / D | Move tiles right |
| R | Restart game |
| Q | Quit game |
Game Rules
- Use arrow keys or WASD to slide all tiles in a direction
- Tiles with the same number merge into one when they collide
- Each move spawns a new tile (2 or 4) in an empty spot
- Combine tiles to reach 2048 and win!
- Game ends when no moves are possible
Features
- Colorful terminal UI matching the original 2048 style
- 256-color support (with fallback for basic terminals)
- Score and best score tracking
- Works on Linux, macOS, and Windows (with WSL)
Requirements
- Python 3.7+
- A terminal that supports curses (most Unix terminals, Windows Terminal with WSL)
Project Structure
tui-2048/
├── pyproject.toml # Package configuration
├── LICENSE # MIT License
├── README.md # This file
├── main.py # Alternative entry point
└── game2048/
├── __init__.py # Package exports & version
├── cli.py # CLI entry point
├── game.py # Core game logic
└── tui.py # Terminal UI rendering
License
MIT License - see LICENSE for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tui_2048-1.0.0.tar.gz
(10.2 kB
view details)
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
tui_2048-1.0.0-py3-none-any.whl
(10.0 kB
view details)
File details
Details for the file tui_2048-1.0.0.tar.gz.
File metadata
- Download URL: tui_2048-1.0.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d52b7994d5d93d9e2fd2aa17dca1eb5057256bd8f7fdf0941bcf788d6248712
|
|
| MD5 |
be2e1cf6208453189344dab9d7650e5a
|
|
| BLAKE2b-256 |
a49626a8bcd9806feea630c2620614871cdf421777a187e2cf78b63441c840a0
|
File details
Details for the file tui_2048-1.0.0-py3-none-any.whl.
File metadata
- Download URL: tui_2048-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
853e36ed9099aac8f9528ab424106193eda0f27c89225c54b297ce5ea8f370d0
|
|
| MD5 |
c3af52565cdedddbf3a40430ec9b7459
|
|
| BLAKE2b-256 |
cdbb727051e7973482c738b5969721e75c5093fdc876a4314d8586c93f28cc4f
|