Skip to content
Snippets Groups Projects
Commit 4cd0fb1e authored by h45-taylor's avatar h45-taylor
Browse files

Testing Readme formatting

parent b4586091
Branches
No related tags found
No related merge requests found
build/
.vscode
Screenshots
\ No newline at end of file
#include "game.hpp"
#include <iostream>
#include <cstdlib>
#include <iomanip>
Board::Board() {
//create a 2D array using std::vector using int for boolen values in
board = std::vector<std::vector<int>>(4, std::vector<int>(4, 0));
STARTER_TILE();
STARTER_TILE();
}
void CREATE_BOARD(){
std::cout << "-*-*-*-*-*-*-*-*-*-*-*-*-*-*-" << std::endl; //just adds boarder
for (size_t X = 0; X < board.size(); X++) // This loops through the row or the X axis using board.size to loop the correct amount.
{
for (size_t Y = 0; Y < board.size(); Y++) // This loops throughthe colums or the Y axis
{
int tile = board[X][Y];
}
std::cout << std::endl;
}
std::cout << "-*-*-*-*-*-*-*-*-*-*-*-*-*-*-" << std::endl;
}
void STARTER_TILE(){
}
\ No newline at end of file
# 2048 Game
## In this Code I am going to be recreating [this game](https://play2048.co/) in a linux command line.
[The Rules](#rules)
## In this Code I am going to be recreating the classic[2048](https://play2048.co/) in a linux command line.
# The Rules
* If 2 of the same numbers touch they will combine and add up to the value of both added together (e.g. if a 2 block touches another 2 block they will combine and become one 4 block)
* If 2 of the same numbers touch they will combine and add up to the value of both
added together (e.g. if a 2 block touches another 2 block they will combine and become one 4 block).
* You can use the 2 common layouts of cursor keys (arrow keys or wasd)
* You can use the 2 common layouts of cursor keys (arrow keys or wasd).
* If there is no empty cells left with no valid moves then the game will end..
## The Aim
The aim of the game is to get one of the blocks upto a score of 2048
\ No newline at end of file
The aim of the game is to get one of the blocks upto a score of 2048
### How its srtuctured
First of all the board is created and 2 randomly placed and valued numbers are added
#pragma once
#include <vector>
class Board {
private:
std::vector<std::vector<int>> board;
public:
Board();
void CREATE_BOARD();
};
\ No newline at end of file
#include "game.hpp"
int main(){
Board game;
return false;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment