• Status New
  • Percent Complete
  • Task Type Patches
  • Category Games
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by Jonas Häggqvist - 2006-06-08
Last edited by Steve Bavin - 2008-07-17

FS#5519 - Sudoku: Ability to chose which difficulty to generate

It would be nice if the “Generate” menu-option opened a submenu where you could pick which difficulty to generate.

I’ve had a quick glance at the code, and it looks like it’d have to generate until a suitable difficulty is found, but that’s no different from what users have to do now, if they’re after a specific difficulty, except it’d happen automatically.

If I get the time/motivation, I may have another look at it in the next couple of days.

Jonas Häggqvist commented on 2006-07-22 16:12

I have now created a patch that does this, only problem is the following warning:

"warning: passing arg 2 of `sudoku_generate' discards qualifiers from pointer target type"

Dominik Riebeling commented on 2006-07-22 17:54

I tried that patch (and fixed that warning), but I ran for like hours or locked up my player / the sim (didn't wait for too long, but at least on my h120 there wasn't a result in a useful time)

Jonas Häggqvist commented on 2007-10-23 01:43

Updated patch by J3TC- in IRC. Untested by me.

Frank Gevaerts commented on 2008-12-12 21:23

Maybe a timeout or maximum number of iterations could help, maybe with a splash on fail? You'd get a wrong difficulty of course, but at least it would end

Jonas Häggqvist commented on 2008-12-13 20:31

This patch adds a counter that defines a maximum number of iterations to try for. It still has the error mentioned in my first comment, because I suck at C. I also don't know what a reasonable number of iterations is.

There's currently no splash on fail - it simply picks the last generated level and uses that as if everything was fine.

Jonas Häggqvist commented on 2008-12-13 21:46

This one fixes the error - thanks to Dominik again :-)

Johannes Linke commented on 2008-12-20 11:40

is this going to be committed?

Dominik Riebeling commented on 2008-12-20 12:09

Is there any need to hurry? If generation simply stops and uses the last generated level that this isn't a good solution, and I think we should find a better one first (though I have no idea how to do this best). At least the user should get informed that the generated level isn't what he asked for.


Available keyboard shortcuts


Task Details

Task Editing