Skip to main content

A terminal-based 2048 game with colorful TUI

Project description

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.

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

tui_2048-1.0.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tui_2048-1.0.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

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

Hashes for tui_2048-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0d52b7994d5d93d9e2fd2aa17dca1eb5057256bd8f7fdf0941bcf788d6248712
MD5 be2e1cf6208453189344dab9d7650e5a
BLAKE2b-256 a49626a8bcd9806feea630c2620614871cdf421777a187e2cf78b63441c840a0

See more details on using hashes here.

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

Hashes for tui_2048-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 853e36ed9099aac8f9528ab424106193eda0f27c89225c54b297ce5ea8f370d0
MD5 c3af52565cdedddbf3a40430ec9b7459
BLAKE2b-256 cdbb727051e7973482c738b5969721e75c5093fdc876a4314d8586c93f28cc4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page