Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Sfabi28/2048

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2048 - Terminal Edition 🎮

C Ncurses 42

A robust and feature-rich implementation of the 2048 game for the terminal, developed as a Rush project at 42.

✨ Features

🔹 Core Gameplay (Mandatory)

  • 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.

🔸 Bonus Extensions

  • 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.

🛠️ Installation & Usage

1. Requirements

  • GCC, Make
  • libncurses (standard on macOS/Linux)
  • libft and ft_printf (Ensure they are accessible as per Makefile)

2. Build

git clone https://github.com/Sfabi28/2048.git
cd 2048/mandatory
make
./2048

2.5 Bonus Build

git clone https://github.com/Sfabi28/2048.git
cd 2048/bonus
make
./2048

3. Controls

Key,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

4. Valgrind

valgrind --leak-check=full --show-leak-kinds=all --suppressions=ignore_ncurses.supp ./2048

About

My 2048 game in C (42 Rush)

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.