Andrew Henninger - 2007-08-29 17:00:27
I've been generating puzzles using the code from Example2.php:
$p = new Sudoku();
$theInitialPosition = $p->generatePuzzle();
$i = new Sudoku();
$i->initializePuzzleFromArray($theInitialPosition);
$i->printSolution();
$p->printSolution();
And often, it will return a blank puzzle.
I put it in a loop like this:
do {
$theInitialPosition = $p->generatePuzzle($level, 50, 10);
} while (strlen(trim($p->getBoardAsString())) == 0);
but this will exceed the 30 second timeout my server has in place.
Is there something I could be doing wrong or is this to be expected?