diff options
Diffstat (limited to 'src/Game.cpp')
| -rw-r--r-- | src/Game.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Game.cpp b/src/Game.cpp index ad8eed0..f5d71e1 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -51,7 +51,7 @@ 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; + if(flag[y][x]) continue; else tileMap[y][x] = 10; int bombs = bombCheck(x, y); @@ -118,7 +118,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 if(tileMap[y][x] == 10) putchar('F'); else putchar('0' + tileMap[y][x] - 1); } putchar('\n'); @@ -186,7 +186,11 @@ void Game::input(){ } } - //if(cmd == "f"){ - // flag[y][x] = true; - //} + if(cmd == "f"){ + if(revealed[y][x]){ + std::cout << "You can't place flag here.\n"; + } else { + flag[y][x] = true; + } + } } |
