forked from len0rd/rockbox
sudoku: fix improper checking if loaded puzzle is valid. blocks also need to be checked.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23630 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
6acfe8edac
commit
b69895eb5f
1 changed files with 3 additions and 3 deletions
|
@ -759,9 +759,9 @@ bool load_sudoku(struct sudoku_state_t* state, char* filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check that the board is valid - we need to check every row/column
|
/* Check that the board is valid - we need to check every row/column
|
||||||
individually, so we check the diagonal from top-left to bottom-right */
|
and block individually */
|
||||||
for (state->x = 0; state->x < 9; state->x++) {
|
for (state->y = 0; state->y < 9; state->y++) {
|
||||||
state->y = state->x;
|
state->x = (state->y%3)*3 + (state->y/3);
|
||||||
if (check_status(state)) return false;
|
if (check_status(state)) return false;
|
||||||
}
|
}
|
||||||
state->x = 0;
|
state->x = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue