There was an error while loading. Please reload this page.
1 parent ada1744 commit 17d946cCopy full SHA for 17d946c
05-Minesweeper-Game/script.js
@@ -138,6 +138,12 @@ function checkMine(r, c) {
138
if (board[r][c].classList.contains("tile-clicked")) {
139
return;
140
}
141
+ // 如果方块被标记为旗帜,则移除旗帜并减少flagCount
142
+ if (tile.innerText == "🚩") {
143
+ tile.innerText = "";
144
+ flagCount -= 1;
145
+ document.getElementById("flag-button").innerText = "🚩" + (flagCount == 0 ? "" : flagCount);
146
+ }
147
148
board[r][c].classList.add("tile-clicked");
149
tilesClicked += 1;
0 commit comments