twozero48 ๐ฐ
May 28, 2026 ยท View on GitHub
A CLI implementation of 2048, in rust
Demo
Installation
To play the game, first install the crate:
cargo install twozero48
If you want to compile from source, ensure you have the rust tool chain installed, by going to after cloning to local and opening the directory in terminal, run
cargo run
Usage
twozero48
twozero48 --board-size 5 --winning 4096
twozero48 --help
---
CONTROLS:
WASD / arrow keys: move
Q / Esc / Ctrl-C: quit
Web App
The web app uses ratzilla to render the same Ratatui game UI in the browser!
check it out: shenoi.dev/twozero48
Build
To build the web app, use trunk(requires wasm toolchain)
rustup target add wasm32-unknown-unknown
cargo install --locked trunk --version 0.21.14
trunk build --release
Acknowledgements
- ratatui - the best way to build terminal UIs. period.
- crossterm - terminal handling done right.
- clap - breeziest cli argument parsing.
- rand - plug and play (pseudo)random number generation.
- criterion - easy benchmarking!
- ratzilla - eazipeazy ratatui on the web.
License
Code in this repository is licensed under the permissive MIT license. All code contributions are by default considered to be under the same.