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:
Teruaki Kawashima 2009-11-15 11:19:58 +00:00
parent 6acfe8edac
commit b69895eb5f

View file

@ -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
individually, so we check the diagonal from top-left to bottom-right */
for (state->x = 0; state->x < 9; state->x++) {
state->y = state->x;
and block individually */
for (state->y = 0; state->y < 9; state->y++) {
state->x = (state->y%3)*3 + (state->y/3);
if (check_status(state)) return false;
}
state->x = 0;