aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzedarider <ymherklotz@gmail.com>2016-02-24 01:18:54 +0000
committerzedarider <ymherklotz@gmail.com>2016-02-24 01:18:54 +0000
commitd3cad948f71e079339b5910e0a0075c346a2e6cd (patch)
treeab6b38c1130a59efa4fc2749ad6b8ce48791b9d6
parent08fdf56e21bcd9fe77508e98c9f65b9847d538ac (diff)
parent0a5ef9619d59eeb0769e1195298ba2f5a37fc6b5 (diff)
downloadimperial_2015-d3cad948f71e079339b5910e0a0075c346a2e6cd.tar.gz
imperial_2015-d3cad948f71e079339b5910e0a0075c346a2e6cd.zip
final changes to game done
-rw-r--r--2048 Game/Game.cpp20
-rw-r--r--2048 Game/Random (1)bin0 -> 8704 bytes
-rw-r--r--2048 Game/configFile.txt7
3 files changed, 27 insertions, 0 deletions
diff --git a/2048 Game/Game.cpp b/2048 Game/Game.cpp
index f2ddf44..7fac05a 100644
--- a/2048 Game/Game.cpp
+++ b/2048 Game/Game.cpp
@@ -6,7 +6,10 @@
#include <string>
#include <sstream>
#include <cstdlib>
+<<<<<<< HEAD
#include <ctime>
+=======
+>>>>>>> 0a5ef9619d59eeb0769e1195298ba2f5a37fc6b5
/*
* defines names for the constants we want to use
@@ -35,7 +38,11 @@ bool checkGameOver(int(&) [GRIDSIZE][GRIDSIZE]);
* as this is easier done by a seperate function
*/
int main(int argc, char* argv[]) {
+<<<<<<< HEAD
// defines the 2D and tmp array that is used to check change
+=======
+ // defines the 2D and tmp array
+>>>>>>> 0a5ef9619d59eeb0769e1195298ba2f5a37fc6b5
int grid[GRIDSIZE][GRIDSIZE];
int before[GRIDSIZE][GRIDSIZE];
// defines tmp string file name to check if file exists
@@ -83,7 +90,13 @@ int main(int argc, char* argv[]) {
*/
while(!checkGameOver(grid)) {
// gets user input
+<<<<<<< HEAD
cin >> usrInput;
+=======
+ cout << "Select move [w,a,s,d]: ";
+ cin >> usrInput;
+ cout << endl;
+>>>>>>> 0a5ef9619d59eeb0769e1195298ba2f5a37fc6b5
// copies the grid into the before grid
for(int i = 0; i < GRIDSIZE; ++i) {
for(int j = 0; j < GRIDSIZE; ++j) {
@@ -94,7 +107,10 @@ int main(int argc, char* argv[]) {
moveGrid(grid, usrInput);
// check if grid has changed which means that the movement was valid
if(checkGridChange(grid, before)){
+<<<<<<< HEAD
cout << endl;
+=======
+>>>>>>> 0a5ef9619d59eeb0769e1195298ba2f5a37fc6b5
// places the random number in the correct base defined above
placeBase(grid);
// prints the grid
@@ -265,4 +281,8 @@ bool checkGameOver(int (&gridArray)[GRIDSIZE][GRIDSIZE]) {
}
// if none of the if statements is true it will end the games
return true;
+<<<<<<< HEAD
+}
+=======
}
+>>>>>>> 0a5ef9619d59eeb0769e1195298ba2f5a37fc6b5
diff --git a/2048 Game/Random (1) b/2048 Game/Random (1)
new file mode 100644
index 0000000..4907ab1
--- /dev/null
+++ b/2048 Game/Random (1)
Binary files differ
diff --git a/2048 Game/configFile.txt b/2048 Game/configFile.txt
index 485ce3e..daa81a6 100644
--- a/2048 Game/configFile.txt
+++ b/2048 Game/configFile.txt
@@ -1,4 +1,11 @@
+<<<<<<< HEAD
2 4 8 16
4 2 16 8
2 4 8 16
4 2 128 128
+=======
+4 2 2 0
+0 0 0 0
+0 0 0 0
+0 0 0 0
+>>>>>>> 0a5ef9619d59eeb0769e1195298ba2f5a37fc6b5