A terminal-based implementation of the popular 2048 game, written in Rust! Play on different grid sizes, combine tiles with the same number, and aim for the highest score.
- Terminal-based UI using the
ratatui
library - Intuitive keyboard controls for smooth gameplay
- Save & load highest score to track your progress
- Multiple difficulty levels:
- 🟢 Easy (4x4 grid)
- 🔵 Medium (5x5 grid)
- 🔴 Hard (6x6 grid)
- Game states:
- 🕹️ Playing
- 💀 Game Over
- ⚙️ Settings
Key | Action |
---|---|
⬆️ ⬇️ ⬅️ ➡️ | Move tiles |
Q | Quit the game |
N | Start a new game |
S | Open settings |
+ | Increase difficulty (bigger grid) |
- | Decrease difficulty (smaller grid) |
📂 Project Layout
src/main.rs
→ Entry point of the applicationsrc/components
→ UI components (game board, game over screen, settings)src/helpers.rs
→ Helper functions for game logic & UIsrc/states.rs
→ Game state management
- Clone the repository:
git clone https://github.com/yourusername/terminal-2048.git cd terminal-2048
- Run the project using Cargo:
cargo run
Special thanks to these amazing libraries:
🎲 Enjoy playing Terminal 2048! 🚀
Please star ⭐ this repo, if you like it.
Feel free to contact me tijan@tijan.dev. Or visit my website.