Reveal the adjacent mines count upon losing the game

This commit is contained in:
2024-08-20 12:07:39 +02:00
parent 5d777daaf3
commit 16568f59dc
+2 -1
View File
@@ -109,7 +109,7 @@ function reveal_mines(cell) {
}
});
}
if (n_mines > 0) {
if (n_mines > 0 && ! cell.classList.contains("mine")) {
cell.innerHTML = ""+n_mines;
cell.classList.add("n"+n_mines);
}
@@ -119,6 +119,7 @@ function lose_game() {
$$("#minefield td").forEach(function (cell) {
cell.classList.remove("unknown");
cell.classList.add("known");
reveal_mines(cell);
});
$("#newgame").style.display = "block";
}