0% found this document useful (0 votes)
142 views1 page

2048 Game Abstract

The document provides an overview of implementing the 2048 puzzle game in C++ using data structures. The game is played on a 4x4 grid where the objective is to combine tiles with the same value by sliding them in directions. Tiles merge when they collide and new tiles are added after each move. The game is won when a 2048 tile is made and lost if no moves are possible.

Uploaded by

Fousiya Fousi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
142 views1 page

2048 Game Abstract

The document provides an overview of implementing the 2048 puzzle game in C++ using data structures. The game is played on a 4x4 grid where the objective is to combine tiles with the same value by sliding them in directions. Tiles merge when they collide and new tiles are added after each move. The game is won when a 2048 tile is made and lost if no moves are possible.

Uploaded by

Fousiya Fousi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

2048 game

Abstract:

The "2048" game is a popular and addictive puzzle game that challenges players to slide numbered
tiles on a grid to combine them and reach the coveted tile with the number 2048. This abstract
provides an overview of a simplified implementation of the 2048 game in C++ using data structures.

Game Mechanics:

1. Game Board: The game is played on a 4x4 grid, represented as a two-dimensional vector in C++.
The grid initially contains two random tiles with values of either 2 or 4.
2. Objective: The player's objective is to combine tiles with the same value by moving them in four
directions (left, right, up, or down) using arrow keys or other input methods. The game continues until
a tile with a value of 2048 is achieved or no more valid moves are possible.
3. Tile Movement: When the player chooses a direction, tiles on the grid slide as far as possible in that
direction until they encounter the grid's boundary or another tile. When two tiles with the same value
collide, they merge into a single tile with double the value. For example, two tiles with a value of 2
combine to form a single tile with a value of 4.
4. Adding New Tiles: After each move, a new tile with a value of either 2 or 4 appears on an empty cell
of the grid.
5. Winning and Losing: The game is won when a tile with a value of 2048 is reached. The game is lost
when no valid moves are available, and the grid is full.

Data Structures:

 Grid Representation: A two-dimensional vector is used to represent the game board, where each
element of the vector holds the value of a tile in the corresponding cell of the grid.
 Random Tile Generation: Random tiles are generated with values of 2 or 4, and their positions are
chosen from empty cells on the grid.

Implementation:

A basic implementation of the game involves initializing the game board, handling user input for tile
movement, merging tiles when they collide, adding new tiles, and checking for win or loss conditions.

Conclusion:

The 2048 game in C++ using data structures provides a practical exercise for programming skills and
data structure knowledge. By extending this basic implementation, one can create a fully functional
and enjoyable version of the game, offering both a fun coding challenge and an entertaining gaming
experience.

Language used : C++


Type:Desktop Application
Database :none
Team Members :FOUSIYA MUHAMMED(811221052),SOORYA(811221011)

You might also like