A lightweight terminal 2048 clone. Endless mode, truecolor tile palette, single-step undo, in-session restart, per-run stats, and opt-in risky-move warnings.
go install github.com/dholms/tui48/cmd/tui48@latest
tui48
- Move: arrow keys, or
ijkl(i=up, j=left, k=down, l=right) - (u)ndo last move
- (r)estart: new game
- (w)arnings: toggle risky-move confirm on/off (default on)
- (s)tats: open / close the stats screen (auto-opens on game-over)
- (q)uit: also
ctrl+c
With warnings on, any move flagged as risky requires a second press of the same direction to confirm. The four risk checks are:
- the move pulls your max tile out of its corner
- the move lets a spawn end the game outright
- the move lets a spawn leave you with only one legal direction
- the move slides tiles off your anchor edge
While armed, the board is wrapped in a red border and the hint line
names the reason. Pressing a different direction re-evaluates against
that direction; pressing any other key (except s, which pops stats
and returns to the armed state) clears the armed state.
Every finished game is appended as one NDJSON line to
$XDG_STATE_HOME/tui48/history.ndjson (falls back to
~/.local/state/tui48/history.ndjson). The stats screen shows
milestone counts, best score, and percentile ranking split between
"clean" runs (no undos used) and all runs.