Skip to content

MerajDerafshi/2048

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

2048 (Console Edition in C++)

header png

A colorful and engaging 2048 game implemented in C++ for the terminal.
This project features a clean and intuitive UI, a smooth menu system, player scoring, and a persistent leaderboard to keep track of your progress.


๐ŸŽฎ Features

  • ๐Ÿ  Main Menu: Choose between starting a new game, viewing the leaderboard, or exiting.
  • ๐Ÿ‘ค Player Names: Each player enters their name before starting the game.
  • ๐ŸŽฏ Smart Scoring: Score is calculated based on tile merges and reaching higher numbers.
  • ๐Ÿ† Leaderboard: Displays players' names, results (Won/Lost/Quit), and scores, sorted by results and score.
  • ๐ŸŽจ Dynamic Colors: Every tile value has its own color (2, 4, 8, 16, โ€ฆ up to 2048).
  • โŒจ๏ธ Easy Controls: Play using W, A, S, D or arrow keys; press ESC to quit anytime.
  • ๐Ÿ’พ Persistent Save: Player results are stored in 2048_leaderboard.txt and loaded on the next run.
  • โšก Fast and Simple UI: Runs directly in the terminal with no extra dependencies.

๐Ÿ“ท Screenshots

๐ŸŽฎ Main Game

Game


๐Ÿ  Main Menu

Menu


๐Ÿฅ‡ Leaderboard (Sorted by Score and Result)

Leaderboard


โš™๏ธ Setup & Run

โœ… Requirements

  • A C++ compiler (e.g., g++, MSVC)
  • Terminal with ANSI color support (Windows Terminal, PowerShell, Linux/macOS terminal)

๐Ÿ“ฆ Build & Run

On Windows:

g++ -o game 2048.cpp
game.exe

On Linux/macOS:

g++ -o game 2048.cpp
./game

๐Ÿ•น๏ธ How to Play

  • Use W, A, S, D or the arrow keys to move tiles.
  • The goal: Reach the 2048 tile!
  • Press ESC to quit the game anytime.
  • After finishing, your score and result will be saved to the leaderboard.

๐Ÿ“ Project Files

  • 2048.cpp โ†’ Main project source code
  • 2048_leaderboard.txt โ†’ Stores leaderboard data

๐Ÿ‘ค Creator

Name: [Meraj Derafshi]
Contact/Portfolio: [https://github.com/MerajDerafshi]


๐Ÿ“œ License

This project is open-source. Feel free to use it for learning or improvements. Attribution is appreciated.

About

๐Ÿ•น๏ธ Terminal game | A minimal clone of famous 2048 game

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages