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.
- ๐ 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,Dor arrow keys; pressESCto quit anytime. - ๐พ Persistent Save: Player results are stored in
2048_leaderboard.txtand loaded on the next run. - โก Fast and Simple UI: Runs directly in the terminal with no extra dependencies.
- A C++ compiler (e.g., g++, MSVC)
- Terminal with ANSI color support (Windows Terminal, PowerShell, Linux/macOS terminal)
g++ -o game 2048.cpp
game.exeg++ -o game 2048.cpp
./game- Use
W,A,S,Dor the arrow keys to move tiles. - The goal: Reach the 2048 tile!
- Press
ESCto quit the game anytime. - After finishing, your score and result will be saved to the leaderboard.
2048.cppโ Main project source code2048_leaderboard.txtโ Stores leaderboard data
Name: [Meraj Derafshi]
Contact/Portfolio: [https://github.com/MerajDerafshi]
This project is open-source. Feel free to use it for learning or improvements. Attribution is appreciated.



