summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-11-15 11:19:58 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-11-15 11:19:58 +0000
commitb69895eb5fa2c4ecb1b4c8cea01d7582f6816043 (patch)
treef4519cdedecaa91fb6bb24ebf649d961447bfeea /apps
parent6acfe8edac7a5031eaf0a4739ae0ef3ee4dc922a (diff)
downloadrockbox-b69895eb5fa2c4ecb1b4c8cea01d7582f6816043.tar.gz
rockbox-b69895eb5fa2c4ecb1b4c8cea01d7582f6816043.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/sudoku/sudoku.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c
index 02de4083dd..412b197ae8 100644
--- a/apps/plugins/sudoku/sudoku.c
+++ b/apps/plugins/sudoku/sudoku.c
@@ -759,9 +759,9 @@ bool load_sudoku(struct sudoku_state_t* state, char* filename)
759 } 759 }
760 760
761 /* Check that the board is valid - we need to check every row/column 761 /* Check that the board is valid - we need to check every row/column
762 individually, so we check the diagonal from top-left to bottom-right */ 762 and block individually */
763 for (state->x = 0; state->x < 9; state->x++) { 763 for (state->y = 0; state->y < 9; state->y++) {
764 state->y = state->x; 764 state->x = (state->y%3)*3 + (state->y/3);
765 if (check_status(state)) return false; 765 if (check_status(state)) return false;
766 } 766 }
767 state->x = 0; 767 state->x = 0;