sudoku: fix FS#7772: Sudoku: "Solve" Crash.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24024 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Teruaki Kawashima 2009-12-16 11:53:36 +00:00
parent 4e89025935
commit d9002eb94a
3 changed files with 48 additions and 3 deletions

View file

@ -283,6 +283,10 @@ static unsigned int cellypos[9]={
#define YOFS ((LCD_HEIGHT-BOARD_HEIGHT)/2)
#endif
#define BLOCK 3
#define SIZE (BLOCK*BLOCK)
#if 0
/****** Solver routine by Tom Shackell <shackell@cs.york.ac.uk>
Downloaded from:
@ -295,9 +299,6 @@ Released under GPLv2
typedef unsigned int Bitset;
#define BLOCK 3
#define SIZE (BLOCK*BLOCK)
#define true 1
#define false 0
@ -569,6 +570,18 @@ void sudoku_solve(struct sudoku_state_t* state)
return;
}
#endif /* 0 */
void sudoku_solve(struct sudoku_state_t* state)
{
bool ret = sudoku_solve_board(state);
if (!ret) {
rb->splash(HZ*2, "Solve failed");
}
return;
}
/* Copies the current to the saved board */
static void save_state(struct sudoku_state_t *state)