diff options
author | Daniel Jones <admin@danieljon.es> | 2020-06-15 22:57:21 +0930 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2020-06-15 22:57:21 +0930 |
commit | 931f12cf9846fbd8cd2c4ae09c55aa359687b7b3 (patch) | |
tree | e45ae82eedab51c1285c7c2d1c8f25d6ca46ccf3 | |
parent | d7c7a5aa1f27d4be5531eaf3ba2e339e35344d6a (diff) | |
download | foxminesweeper-931f12cf9846fbd8cd2c4ae09c55aa359687b7b3.tar.gz foxminesweeper-931f12cf9846fbd8cd2c4ae09c55aa359687b7b3.zip |
remove flagging mines as win condition
-rw-r--r-- | Board.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -216,9 +216,7 @@ Board::reveal_neighbor_tiles(int x, int y) bool Board::check_win() { - int allowedmines = minecount; int safetiles = (height * width) - minecount; - int correctflags = 0; int correcttiles = 0; for (int y = 0; y < height; y++) @@ -226,12 +224,10 @@ Board::check_win() for (int x = 0; x < width; x++) { Tile *tile = get_tile_at(x, y); - if (tile->is_mine() && tile->is_flagged()) - correctflags++; - else if (!(tile->is_mine()) && (tile->is_revealed())) + if (!(tile->is_mine()) && (tile->is_revealed())) correcttiles++; } } - return (correctflags == allowedmines) || (correcttiles == safetiles); + return (correcttiles == safetiles); } |