Restart update after identifying mine

This commit is contained in:
Camden Dixie O'Brien 2025-03-06 22:05:29 +00:00
parent 6394dcb819
commit e33c64e5ae

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);