messersm/sudokutools

Is there any way to define the difficulty ?

afkcodes opened this issue · 4 comments

Hello, this tool is awesome, but it seems you have left/pause the development please dont do that this tool is so cool. Thanks for this wonderful tool. Just wanted to know that if there is anyway to generate puzzles with varying difficulty ?

Hi @afkcodes,

first of all: thank you for your kind words.

Yeah development is pretty much stalled right now, but you can achieve what you want, by first generating a bunch of sudokus and then filtering with analyze.rate() (as far as I can tell, other sudoku tools work like this as well). Something like that should work:

import rate from sudokutools.analyze
import generate from sudokutools.generate

MIN_RATING = 4
MAX_RATING = 5

COUNT = 20

sudokus = []

while len(sudokus) < COUNT:
    sudoku = generate()
    if MIN_RATING <= rate(sudoku) <= MAX_RATING:
        sudokus.append(sudoku)

# do something with the sudokus list here

See also: https://sudokutools.readthedocs.io/en/latest/library.html#sudokutools.analyze.rate

Are there any other features, you would like to see in the library? Maybe I can create some roadmap and then I (or others) can slowly chip away at it.

Thanks for such a detailed answer, Yeah actually i am making a game and if you can make this tool more robust it will be so awesome to make my game power by sudoku tools.

The features that I have in my mind

Custom Dimensions like 6x6, 12x12 with custom Difficulty
Sudoku Variations Like Excaliber, Queens Gambit, Jigsaw, etc
Human Rater

will add more if I get to think something more, please do not abandon this awesome project.

Thanks for the suggestions. I will look into it, if I have some time.

Concerning sudoku dimensions, please take a look at the README: https://github.com/messersm/sudokutools#different-sudoku-sizes

What do you mean with "Human Rater"?

Human Rater is basically a technique where it solves the sudoku as a human would do and rate the puzzle difficulty, if not we can use something like sudoku explainer rater or we can use the same.