Restart update after identifying mine
This commit is contained in:
parent
6394dcb819
commit
e33c64e5ae
5
main.c
5
main.c
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user