sudoku icon indicating copy to clipboard operation
sudoku copied to clipboard

Support for pencilmark Sudoku

Open dudozermaks opened this issue 6 months ago • 5 comments

Hi! Thanks for beautiful crate! Is there any way to add support for pencilmark Sudoku? Are you planning to do that?

dudozermaks avatar Feb 15 '24 12:02 dudozermaks

The StrategySolver has the ability to read from and produce grids of possible numbers like the one below, if that's what you're asking about. If you are talking about a sudoku variant, I am not familiar with it.

┌──────────────────────────────┬──────────────────────────────┬──────────────────────────────┐
│ 1         2         3        │ 4         5         6        │ 7         8         _        │
│ 45678     45678     45678    │ 12378     12378     12378    │ 123456    123456    9        │
│ 456789    456789    456789   │ 123789    123789    123789   │ 123456    123456    123456   │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ 23456789  13456789  12456789 │ 12356789  12346789  12345789 │ 12345689  12345679  12345678 │
│ 23456789  13456789  12456789 │ 12356789  12346789  12345789 │ 12345689  12345679  12345678 │
│ 23456789  13456789  12456789 │ 12356789  12346789  12345789 │ 12345689  12345679  12345678 │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ 23456789  13456789  12456789 │ 12356789  12346789  12345789 │ 12345689  12345679  12345678 │
│ 23456789  13456789  12456789 │ 12356789  12346789  12345789 │ 12345689  12345679  12345678 │
│ 23456789  13456789  12456789 │ 12356789  12346789  12345789 │ 12345689  12345679  12345678 │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘

The StrategySolver is quite unfinished however. There are many strategies beyond the ones that are currently implemented.

Emerentius avatar Feb 15 '24 14:02 Emerentius

Oh, did not check StrategySolver, just checked Sudoku struct, sorry. Yeah, the first variant is correct, I mean grid of possible numbers.

StrategySolver is almost everything I need (in my case, just rate Sudoku by difficulty + check unique solution). But is it possible to implement this for Sudoku and SudokuSolver structs (to check for unique solution, for example)?

dudozermaks avatar Feb 15 '24 14:02 dudozermaks

The StrategySolver can produce a regular Sudoku struct. Unless otherwise specified, the solution the library is looking for is always unique. The library isn't really a good fit for rating sudokus currently. It would need more strategies to be implemented and I haven't had the motivation to add more.

Emerentius avatar Feb 16 '24 08:02 Emerentius

I'll rephrase my question. Is it possible to implement a feature to load the grid of possible numbers (like above) into a Sudoku struct? And if yes, are you planning to do that?

dudozermaks avatar Feb 16 '24 12:02 dudozermaks

The Sudoku struct only contains a list of clues so loading a pencilmark grid into it is not that useful.

Emerentius avatar Mar 11 '24 09:03 Emerentius