A robust and feature-rich implementation of the 2048 game for the terminal, developed as a Rush project at 42.
- Game Logic: Authentic movement, merging rules, and random spawning (2 or 4).
- Win/Loss: Detects 2048 victory (with option to continue) and Game Over states.
- Stability: Handles window resizing signals (
SIGWINCH) seamlessly.
- Dynamic Grid: Choose between 4x4 (Classic) and 5x5 (Big Board) via Settings.
- Visuals: Custom ASCII Art font for numbers, box-drawing borders, and dynamic Colors (cold to hot gradient).
- Persistence: Independent High Scores saved for each grid size (
.best_score_4,.best_score_5). Scores are saved in real-time to prevent data loss.
- GCC, Make
libncurses(standard on macOS/Linux)libftandft_printf(Ensure they are accessible as per Makefile)
git clone https://github.com/Sfabi28/2048.git
cd 2048/mandatory
make
./2048git clone https://github.com/Sfabi28/2048.git
cd 2048/bonus
make
./2048Key,Context,Action ↑ ↓ ← →,Game,Move tiles / Merge numbers ↑ ↓,Menu,Navigate options 1 / 2,Menu,Quick select (Start / Settings) ESC,Global,Return to Menu / Quit Game ENTER,Win,Continue playing after 2048
valgrind --leak-check=full --show-leak-kinds=all --suppressions=ignore_ncurses.supp ./2048