Restart update after identifying mine

This commit is contained in:
2025-03-22 13:33:38 +00:00
parent 6400079289
commit 778b2defdd

5
main.c
View File

@@ -70,6 +70,7 @@ int main(void)
break;
}
update:
for (y = 0; y < HEIGHT; ++y) {
for (x = 0; x < WIDTH; ++x) {
if (field[x][y] == UNKNOWN || field[x][y] == MINE)
@@ -80,8 +81,10 @@ int main(void)
if (unknowns == 0)
continue;
if (mines + unknowns == field[x][y])
if (mines + unknowns == field[x][y]) {
setadj(field, x, y, UNKNOWN, MINE);
goto update;
}
if (mines == field[x][y]) {
getadj(field, &x, &y, UNKNOWN);