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.
Metadata
Release files for tui-2048 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tui_2048-1.0.0.tar.gz | 10.2 kB | Without provenance | Details for tui_2048-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tui_2048-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for tui_2048-1.0.0-py3-none-any.whl |
Total release size: 20.2 kB
Release files / tui_2048-1.0.0.tar.gz
| Download URL | tui_2048-1.0.0.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d52b7994d5d93d9e2fd2aa17dca1eb5057256bd8f7fdf0941bcf788d6248712
|
|
BLAKE2b-256 checksum How to use checksums |
a49626a8bcd9806feea630c2620614871cdf421777a187e2cf78b63441c840a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.6
|
Release files / tui_2048-1.0.0-py3-none-any.whl
| Download URL | tui_2048-1.0.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
853e36ed9099aac8f9528ab424106193eda0f27c89225c54b297ce5ea8f370d0
|
|
BLAKE2b-256 checksum How to use checksums |
cdbb727051e7973482c738b5969721e75c5093fdc876a4314d8586c93f28cc4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.6
|
Security for tui-2048 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.