I am doing a sudoku game. My problem is the generation of sudoku questions. I want to generate questions in three difficulties. Is there any idea to generate 3 level questions?
Asked
Active
Viewed 714 times
1
-
This would seem more apt for game development. – Marcin Jan 19 '12 at 10:45
-
possible duplicate of [Creating sudoku initial boards](http://stackoverflow.com/questions/3218223/creating-sudoku-initial-boards) – outis Jan 20 '12 at 07:44
2 Answers
2
If we go for pre generated sudoku puzzles, maybe you could have a look at this : http://www.setbb.com/phpbb/viewtopic.php?t=102&mforum=sudoku
we used terminal sudoku in the Linux distributions
it has a batch generator mode. the website is down but it is packaged for some linux distributions.
generate puzzles for each level : easy, medium and hard
sudoku -fcompact -ceasy -g5>sudoku_easy.txt
sudoku -fcompact -cmedium -g5>sudoku_medium.txt
sudoku -fcompact -chard -g5>sudoku_hard.txt
solve the puzzles
sudoku -fcompact -v sudoku_easy.txt >sudoku_easy-resolved.txt
sudoku -fcompact -v sudoku_medium.txt >sudoku_medium-resolved.txt
sudoku -fcompact -v sudoku_hard.txt >sudoku_hard-resolved.txt
I checked some of them and they had only one solution.

Jackson Chengalai
- 3,907
- 1
- 24
- 39
1
Generate full (filled) sudokus and before printing the sudoku out, make some percentage of the fields empty again for the human to fill.
Select random fields to empty. Raise the percentage of empty fields on each difficulty level.

jkj
- 2,561
- 1
- 17
- 24
-
@DanielFischer might not even be necessary. The original sudoku makes sure there is at least one solution. The human filled solution can then be checked separately. – jkj Jan 19 '12 at 10:08
-
But you need uniqueness, otherwise it's pointless. And uniqueness is easily lost when removing hints. – Daniel Fischer Jan 19 '12 at 10:14
-
@DanielFischer why is uniqueness required? you can just compute the user's solution and see all their values are correct or not – Seph Jan 19 '12 at 10:31
-
If there's more than one solution, it's not a logical puzzle anymore. The point is that the solution shall be found by deduction, not by trial and error. If it's not unique, that is impossible. – Daniel Fischer Jan 19 '12 at 10:36
-
-
Any serious Sudoku solver will hate it if it's not unique. (by definition;) – Daniel Fischer Jan 19 '12 at 10:46