Skip to main content

2048 TUI Game

A terminal-based implementation of the classic 2048 puzzle game using Python and curses.

Python Version License

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

  1. Use arrow keys or WASD to slide all tiles in a direction
  2. Tiles with the same number merge into one when they collide
  3. Each move spawns a new tile (2 or 4) in an empty spot
  4. Combine tiles to reach 2048 and win!
  5. 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)

Source distribution for tui-2048 1.0.0
File Size Uploaded
tui_2048-1.0.0.tar.gz 10.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tui-2048 1.0.0
File Interpreter ABI Platform
tui_2048-1.0.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page