Rockbox Technical Forums

Support and General Use => Plugins/Viewers => Topic started by: darkarn on December 20, 2008, 03:06:28 PM

Title: How to select difficulty level for Sudoku?
Post by: darkarn on December 20, 2008, 03:06:28 PM
Hi! I am new to Sudoku and hence wanted to play it on my H10. Problem is, I always get those puzzles that are more difficult than "Medium"! Is it possible to change the difficulty level to "Easy"? If not, is there an alternative?

Thanks!
Title: Re: How to select difficulty level for Sudoku?
Post by: karashata on December 20, 2008, 03:12:57 PM
It doesn't look like you can set the difficulty level at all, it generates the puzzles randomly... Someone correct me if I'm wrong, but I don't see any menu option for level setting...

I can only guess there are some "easy" puzzles in there somewhere, you'll just have to keep generating puzzles until one comes up "easy" (unless someone knows how to set the level...)
Title: Re: How to select difficulty level for Sudoku?
Post by: Llorean on December 20, 2008, 03:25:07 PM
The Sudoku plugin can only generate random ones, then after they're generated tell you what difficulty they are. There's no option to set the difficulty in advance.

Another option is to search the internet for sudoku .ss files. It's a pretty standard format, and you can download puzzles in it that you can load and play with our plugin. Using this you can download, for example, a collection of easier puzzles if you find one.
Title: Re: How to select difficulty level for Sudoku?
Post by: darkarn on December 21, 2008, 02:00:02 PM
Hmm... Ok... But is it possible to change something within the source code of the plugin to tweak the randomness of the puzzles?
Title: Re: How to select difficulty level for Sudoku?
Post by: Llorean on December 21, 2008, 06:55:03 PM
Yes, you could. It wouldn't be simple.
Title: Re: How to select difficulty level for Sudoku?
Post by: darkarn on December 22, 2008, 11:09:43 AM
Erm, what do you mean? Is there anything extra I need to do?
Title: Re: How to select difficulty level for Sudoku?
Post by: Llorean on December 22, 2008, 11:12:03 AM
You need to program a way to generate not-entirely random puzzles.
Title: Re: How to select difficulty level for Sudoku?
Post by: darkarn on December 22, 2008, 11:22:51 AM
I was thinking of modifying the probability of getting an Easy puzzle...
Title: Re: How to select difficulty level for Sudoku?
Post by: Llorean on December 22, 2008, 11:24:08 AM
And that would require coming up with a way to generate easy puzzles. It's not as simple as saying "give me more easy puzzles."
Title: Re: How to select difficulty level for Sudoku?
Post by: darkarn on December 22, 2008, 11:29:09 AM
Oh, ok. I thought that puzzles are created by using probabilities eg 10% chance to create easy puzzles or 10% chance that puzzle has 16 squares filled etc.
Title: Re: How to select difficulty level for Sudoku?
Post by: Multiplex on December 22, 2008, 01:57:03 PM
There are two basic issues here;
A) the way the Rockbox plugin works
B) the rating of difficulty of Sudoku puzzles

A) the way the plugin works(if I remember correctly) is to randomly add numbers to a blank grid in a symmetrical manner and see if it can be solved and has a unique solution. You might be able to tweak the algorithm to make it have more givens.

BUT

B) the number of givens is not a very accurate guide of how difficult a puzzle is - in one Christmas edition the NewScientist gave two puzzles with 17 givens (the minimum) one was fairly easy - the other a nightmare!

Programs like Simple Sudoku http://angusj.com/sudoku/ seem to have a better algorithm based on what techniques the solver needs to use to solve them (the Rockbox one is brute force), you could pre-calculate a load then put them on your player.