LinuxCommandLibrary

2048

Play the 2048 puzzle game

SYNOPSIS

2048 [options]

PARAMETERS

-h, --help
    Display usage information and exit

-v, --version
    Print version number and exit

-s N, --size N
    Set grid size to N (default: 4, range typically 3-9)

-c, --colors[=N]
    Enable colors (N=0 to disable, levels 1-3 for intensity)

-t THEME, --theme THEME
    Set color theme (e.g., classic, dark, light, matrix)

-a, --ai
    Enable AI player mode

-r, --restart
    Restart game on loss (keep playing)

-k, --keep-score
    Keep current score on restart

DESCRIPTION

The 2048 command launches a ncurses-based version of the addictive 2048 puzzle game in your Linux terminal. Originally a web game by Gabriele Cirulli in 2014, this CLI port lets you slide numbered tiles on a grid using arrow keys or WASD. Tiles with the same number merge when adjacent, doubling their value (2+2=4, 4+4=8, up to 2048). After each move, a new 2 or 4 tile appears randomly. The goal is to reach the 2048 tile while achieving the highest score. The game ends ('game over') when the grid fills with no possible moves. Features vary by implementation but often include customizable grid sizes (default 4x4), color themes, AI autoplay, preset boards for testing, score persistence, and restart options. It's lightweight, runs in any terminal supporting ncurses, and is perfect for quick sessions or scoring challenges. High scores are tracked locally.

CAVEATS

Requires ncurses library and color-supporting terminal (e.g., xterm-256color).
May not work well in screen multiplexers without proper TERM. Scores saved to ~/.2048.score. Limited to integer grid sizes.

CONTROLS

Arrow keys or WASD to slide tiles.
R: restart, Q or Ctrl+C: quit.
Score and best displayed live.

SCORING

Points awarded per merge: 4=4, 8=8, etc. (value of new tile).
High score persists across sessions.

HISTORY

Created by Gabriele Cirulli as a web game in March 2014. CLI version by tremby released days later, gaining popularity on GitHub. Packaged in distros like Ubuntu/Debian as '2048' (section 6). Evolved with AI, themes, and variants; actively maintained for modern terminals.

SEE ALSO

ncurse(3), sl(6), pacman4console(6)

Copied to clipboard