summaryrefslogtreecommitdiff
path: root/src/Game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Game.cpp')
-rw-r--r--src/Game.cpp6
1 files changed, 6 insertions, 0 deletions
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")
}