我正在做数独游戏。我的问题是数独问题的产生。我想在三个困难中提出问题。有什么想法可以生成 3 个级别的问题吗?
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.
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.