2048
HTML/CSS/JavaScript 2048 with deterministic merges, random spawns, undo, saved best score, swipe input, and board summaries.
- Status
- Archived experiment / live demo
- Last updated
- May 2026
- Controls
- Slide tiles to merge matching numbers and build toward the highest tile you can reach.
- Keyboard
- Focus the board, use Arrow/WASD to move, Enter/Space to start, and Ctrl/Cmd+Z to undo.
- Touch
- Swipe horizontally or vertically on the board, or use the labeled direction buttons below it.
- Accessibility
- The board has a screen-reader summary, and score, move count, win, and game-over updates are announced.
Ready
2048 ready.
Keyboard and touch controls
Keyboard shortcuts
- Arrow keysMove tiles up, right, down, or left.
- W A S DAlternate movement keys for the same four directions.
- Enter / SpaceStart the game when the start menu is visible.
- Ctrl/Cmd+ZUndo the previous move when a move is available.
Touch controls
- SwipeSwipe on the board to move tiles in that direction.
- Direction buttonsUse the four large buttons below the board.
- Undo buttonUse the page action button to revert one move.
2048 board
Focus the board, then use Arrow keys or W, A, S, and D. Press Control Z or Command Z to undo.
On touch screens, swipe on the board or use the labeled direction buttons below the board.
Board not started.
Board transforms, history, and input.
Main state tracks board, score, best, moves, undo, and win/loss. Each move compresses, merges, spawns, and re-renders through one input path.
Tile engine, input, and feedback.
- Implemented directional board transforms, merge rules, random tile spawning, win/loss checks, score updates, and move counting.
- Built undo snapshots, local save/best-score persistence, keyboard shortcuts, swipe handling, and on-screen direction controls.
- Added a focusable board with row summaries, live status, and separate visual tiles.
2048 rules are established; this no-dependency browser implementation is custom.
Archived experiment with solid board state.
Solid: merges, undo, persistence, swipe, keyboard controls, and summaries. Hardening: merge tests, save migration/reset, and screen-reader checks.
Static game with browser persistence.
GitHub Pages serves 2048.html, 2048.css, and 2048.js. No env vars or external APIs. Local: run python -m http.server 8000 and open /2048.html. State stays local.