summaryrefslogtreecommitdiff
path: root/src/Game.cpp
diff options
context:
space:
mode:
authordawidg81 <dawidgorski.m@gmail.com>2026-02-03 14:52:35 +0100
committerdawidg81 <dawidgorski.m@gmail.com>2026-02-03 14:52:35 +0100
commitcd14289702fd22ed65536dccd61fd9569198b644 (patch)
treebb561b62822ba8334caced03dfbce3b1fa9ad9f9 /src/Game.cpp
parentb39ee318ac6cd9d7d1eeeb7ed9df6dfa4aeec924 (diff)
Revoked placing flags feature
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")
}