-
Notifications
You must be signed in to change notification settings - Fork 1
/
game.h
49 lines (38 loc) · 1 KB
/
game.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//using namespace std;
#define NOT_SET 0
#define QUIT 1
#define LEFT 10
#define RIGHT 11
#define UP 12
#define DOWN 13
#define WINNING_INT 2048 //The default value could be 2048
#include <stdio.h> // printf, NULL
#include <iostream>
#include <stdlib.h> // srand, rand
#include <time.h> // time
#include <math.h> // Power and sqr
#include <string>
#include <list>
using namespace std;
class Game
{
int** board;
private:
int length; //There is probably a better way
void newBoard(int size);
bool checkIfGameOver(); //Is not finished
void insertNewNumber();
//Move direction and execute move works together
void moveDirection(int direct);
bool executeMove(int start_x , int start_y, int check_x , int check_y);
void PrintBoard();
string getColourString(int num);
void clearScreen();
int returnRandomPlate();
int input(string mess);
bool checkIfVictorius();
int returnHighestNumber();
string uniqString();
public:
int startGame(int size, list<string>* history);
};