aboutsummaryrefslogtreecommitdiffstats
path: root/2048 Game
diff options
context:
space:
mode:
Diffstat (limited to '2048 Game')
-rw-r--r--2048 Game/2048 Design Choices.odtbin0 -> 14000 bytes
-rw-r--r--2048 Game/2048 Design Choices.pdfbin0 -> 92806 bytes
-rwxr-xr-x[-rw-r--r--]2048 Game/Gamebin15792 -> 15832 bytes
-rw-r--r--2048 Game/Game.cpp22
-rw-r--r--2048 Game/Game.zipbin0 -> 92078 bytes
-rw-r--r--2048 Game/Randombin0 -> 8704 bytes
-rw-r--r--2048 Game/configFile.txt9
-rwxr-xr-x2048 Game/pointersbin0 -> 8816 bytes
-rw-r--r--2048 Game/pointers.cpp12
9 files changed, 41 insertions, 2 deletions
diff --git a/2048 Game/2048 Design Choices.odt b/2048 Game/2048 Design Choices.odt
new file mode 100644
index 0000000..1ac1393
--- /dev/null
+++ b/2048 Game/2048 Design Choices.odt
Binary files differ
diff --git a/2048 Game/2048 Design Choices.pdf b/2048 Game/2048 Design Choices.pdf
new file mode 100644
index 0000000..84b0be2
--- /dev/null
+++ b/2048 Game/2048 Design Choices.pdf
Binary files differ
diff --git a/2048 Game/Game b/2048 Game/Game
index a00ba24..69a60a1 100644..100755
--- a/2048 Game/Game
+++ b/2048 Game/Game
Binary files differ
diff --git a/2048 Game/Game.cpp b/2048 Game/Game.cpp
index 3b5232f..7fac05a 100644
--- a/2048 Game/Game.cpp
+++ b/2048 Game/Game.cpp
@@ -6,6 +6,10 @@
#include <string>
#include <sstream>
#include <cstdlib>
+<<<<<<< HEAD
+#include <ctime>
+=======
+>>>>>>> 0a5ef9619d59eeb0769e1195298ba2f5a37fc6b5
/*
* defines names for the constants we want to use
@@ -34,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
@@ -82,9 +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) {
@@ -95,6 +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;
-} \ No newline at end of file
+<<<<<<< HEAD
+}
+=======
+}
+>>>>>>> 0a5ef9619d59eeb0769e1195298ba2f5a37fc6b5
diff --git a/2048 Game/Game.zip b/2048 Game/Game.zip
new file mode 100644
index 0000000..a09d5de
--- /dev/null
+++ b/2048 Game/Game.zip
Binary files differ
diff --git a/2048 Game/Random b/2048 Game/Random
new file mode 100644
index 0000000..4907ab1
--- /dev/null
+++ b/2048 Game/Random
Binary files differ
diff --git a/2048 Game/configFile.txt b/2048 Game/configFile.txt
index 0a28df6..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 \ No newline at end of file
+0 0 0 0
+>>>>>>> 0a5ef9619d59eeb0769e1195298ba2f5a37fc6b5
diff --git a/2048 Game/pointers b/2048 Game/pointers
new file mode 100755
index 0000000..cf488a6
--- /dev/null
+++ b/2048 Game/pointers
Binary files differ
diff --git a/2048 Game/pointers.cpp b/2048 Game/pointers.cpp
new file mode 100644
index 0000000..536f87f
--- /dev/null
+++ b/2048 Game/pointers.cpp
@@ -0,0 +1,12 @@
+#include <iostream>
+
+using namespace std;
+
+int main() {
+ int array[2];
+ array[0] = 5;
+ array[1] = 2;
+
+ cout << "array: " << array << ", array2: " << &array[1] << endl;
+ cout << "size of int: " << sizeof(int) << endl;
+}