summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xminesweeperbin0 -> 53712 bytes
-rw-r--r--src/Game.cpp6
-rw-r--r--src/Game.hpp1
-rw-r--r--src/Game.obin0 -> 15680 bytes
-rw-r--r--src/main.obin0 -> 7336 bytes
5 files changed, 7 insertions, 0 deletions
diff --git a/minesweeper b/minesweeper
new file mode 100755
index 0000000..4d37823
--- /dev/null
+++ b/minesweeper
Binary files differ
diff --git a/src/Game.cpp b/src/Game.cpp
index 327e179..e08ab24 100644
--- a/src/Game.cpp
+++ b/src/Game.cpp
@@ -34,6 +34,7 @@ void Game::initBoard(){
bombMap[y][x] = false;
revealed[y][x] = false;
tileMap[y][x] = 0;
+ flag[y][x] = false;
}
}
@@ -53,6 +54,8 @@ void Game::updateBoard(){
for(int y=0; y < boardHeight; y++){
for(int x=0; x < boardWidth; x++){
if(!revealed[y][x]) continue;
+ if(!flag[y][x]) continue;
+ else tileMap[y][x] = 10;
int bombs = bombCheck(x, y);
tileMap[y][x] = bombs == 0 ? 1 : bombs + 1;
@@ -118,6 +121,7 @@ void Game::displayBoard() {
for(int x = 0; x < boardWidth; x++){
if(tileMap[y][x] == 0) putchar('#');
else if(tileMap[y][x] == 1) putchar('.');
+ else if(tileMap[y][x] == 10) putchar('F');
else putchar('0' + tileMap[y][x] - 1);
}
putchar('\n');
@@ -184,4 +188,6 @@ void Game::input(){
}
}
}
+
+ if(cmd == "f")
}
diff --git a/src/Game.hpp b/src/Game.hpp
index 207202f..ca3cb33 100644
--- a/src/Game.hpp
+++ b/src/Game.hpp
@@ -11,6 +11,7 @@ private:
bool bombMap[MAX_H][MAX_W];
int tileMap[MAX_H][MAX_W];
bool revealed[MAX_H][MAX_W];
+ bool flag[MAX_H][MAX_W];
int mines;
diff --git a/src/Game.o b/src/Game.o
new file mode 100644
index 0000000..813d1bb
--- /dev/null
+++ b/src/Game.o
Binary files differ
diff --git a/src/main.o b/src/main.o
new file mode 100644
index 0000000..0751ff9
--- /dev/null
+++ b/src/main.o
Binary files differ