8000 GitHub - Shreyashofficial05/cpp-1024-game: Simple terminal-based implementation of the 1024 game written in C++.
[go: up one dir, main page]

Skip to content

Shreyashofficial05/cpp-1024-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

C++ 1024 Game License: MIT

A simple terminal-based implementation of the 1024 game in C++.

Installation & Usage

  1. Compile with C++11 support:
    g++ -std=c++11 project.cpp -o 1024game
  2. Run the executable:
    ./1024game

How to Play

The game starts with a 4x4 grid containing two initial tiles (2 or 4). Use arrow keys to move tiles:

  • Tiles slide in the chosen direction
  • When two tiles with the same number collide, they merge into one tile with their sum
  • After each move, a new tile (2 or 4) appears in an empty spot
  • Game ends when you reach 1024 tile or no valid moves remain

Controls

  • Arrow keys: Move tiles
  • 'q' key: Quit the game

Objective

Reach the 1024 tile by merging matching tiles while managing limited grid space.

License

This project is licensed under the MIT License - see LICENSE file for details

Languages

0