View Full Version : Puzzle Generation Endless looping
ItsCosmo
Oct 2, 2005, 10:13 AM
Hello,
I have tried on several occasions to use the "Build Puzzle" feature. Why? Because it's there, of course. On each of these occasions, after several minutes of cranking away, the program announces that the puzzle is "too easy" and starts over. This cycle repeats with no end until I finally give up.
1. Is this a bug?
2. With so many existing puzzle packs, why would I want to use this feature in the first place?
BTW, this is a great implmentation of Sudoku! I look forward to version 1.x, which I hope will have:
1. Unlimited Undo.
2. Save/recall, including auto saving of games in progress when switching games.
3. Hints that actually take my pencil mark eliminatons into account.
Howard
Oct 2, 2005, 12:02 PM
Thanks for your message!
1. Is this a bug?
Nope! The generator works by creating various grids and testing to see how difficult they are. It tries to create a puzzle within the difficulty range you ask for. For easy puzzles that doesn't take so long. For harder puzzles it has to keep retrying until it gets a puzzle which is valid. A valid puzzle is solvable by logical techniques alone, has a single solution, and (for aesthetic reasons) has rotational symmetry. Unfortunately, testing for the hardest puzzles means using techniques which take a lot of CPU cycles (processing effort), and this takes some time. If it doesn't manage to create a valid puzzle of your specification after 1000(ish) tries from the same starting grid, it will try again with a new grid.
It almost certainly found plenty of valid Sudoku puzzles, but maybe with too many starting values, or not hard enough for you!
If you'd asked for a fiendish puzzle, and it gave you a trivial one, that would be a bug :)
Of course, it would be nice if it worked faster! On OS5 devices, it has to translate 68000 code to ARM code, which is not so efficient. In a future version, we're hoping to include an ARM native version of the builder which should be quite a bit faster. It will still have to run through several times, but they should be measured in (tens of) seconds rather than minutes.
2. With so many existing puzzle packs, why would I want to use this feature in the first place?
If you've got the extra packs installed (and I'll keep providing more pre-built ones) then you don't! However, some people don't like the thought of potentially running out, and so being able to build is nice too. I personally don't imagine I'll ever get through all of the Fiendish and harder puzzles I've already built, there's already a few years worth for me ;)
BTW, this is a great implmentation of Sudoku! I look forward to version 1.x, which I hope will have:
1. Unlimited Undo.
2. Save/recall, including auto saving of games in progress when switching games.
3. Hints that actually take my pencil mark eliminatons into account.
Thanks for the comment :)
1.x (not specifying exactly which x!) will have these features. We'll do updates adding extra bits as we go along.
The eliminations question is a tricky one... If you're not using auto-pencilmarks, and you ask the system to provide a hint based on your pencilmarks... there's a potential problem.
If you don't have a pencilmark in a particular place, that could be:
1) Because you haven't put one in there yet.
2) Because you put one in and removed it through using a technique that the solver doesn't know about. (it could happen!)
3) Because you've removed it by accident.
Either way, the solver would give a hint that it couldn't have worked out by its own (correct) logic. That might mean the hint is potentially incorrect... would you be happy with it using your pencilmarks, but giving you an invalid hint?
We will be making it an option to force it to use your pencilmarks (rather than its own internal set that it recalculates from simple eliminations when you ask for a hint) if you don't have auto-pencilmarks turned on.
I (personally) recommend that if you're playing on harder puzzles and want to have the hints available, that you use the auto-pencilmarks option. (Yes, this does make spotting single-candidates - a.k.a. naked singles - very easy, but it does allow you to concentrate on the harder techniques)
Howard.
Kristopher
Oct 3, 2005, 02:43 AM
I have an idea for Sudoku's built-in puzzle generator that could make it a better alternative to downloading puzzles. It is very unusual, but since noone else has suggested anything like it, I though I would mention it anyway.
Since alarms can turn on a Palm at a given time (including Busker's MP3 alarm), I will assume a program could also start running at a given time. Suppose this time was 4AM or thereabouts, when the Palm is charging and it is not being used. At 4AM, Astraware Sudoku (or another program made to work with it) could start generating random Sudoku puzzles. It could, over the following hour, generate something like 2 puzzles of each difficulty level. When it is done with that, it could turn the Palm off (Win Launcher has a power-off menu feature). That way, without downloading puzzles or ever waiting for them to be written, a Sudoku fan could have new puzzles to play every day.
:) Awaiting Reply... :)
Howard
Oct 3, 2005, 09:51 AM
This is something we considered, however it is non-trivial to implement "nicely" (i.e. taking account of all user preferences, making sure the battery isn't abused etc.)
It is already on the consideration list for later though.
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.