DylanSp / sudoku-toolkit

Go toolkit for generating, solving, and otherwise analyzing Sudoku puzzles.
MIT License
0 stars 0 forks source link

Try implementing solver algorithms as composable functions with a common type #7

Open DylanSp opened 8 months ago

DylanSp commented 8 months ago

Potentially have a common type for strategies/solvers, which can be composed. That way I can define strategies such as:

Norvig's solver would be something like BasicSolver + BacktrackingSearch.

This might help with generating puzzles of a chosen difficulty (see https://github.com/DylanSp/sudoku-toolkit/issues/3) - each difficulty level's generator would use a solver with a different composition of strategies.

Don't introduce this abstraction right away (definitely do https://github.com/DylanSp/sudoku-toolkit/issues/1 first, possibly https://github.com/DylanSp/sudoku-toolkit/issues/2 as well). Wait until I start work on the generator, then see if this abstraction might help, and what it should look like.