I wrote a Sudoku solver using a SAT solver compiled to wasm (it is just a simple exercise TBH):
https://www.nhatcher.com/hats/sudoku.html https://www.nhatcher.com/post/on-hats-and-sats/
And the WASM solver is super cool, definitely useful for generating them as you have to do quite a lot of iterations!
Once upon a time I programmed a solution finder for the game https://en.wikipedia.org/wiki/Ricochet_Robots because a gaming magazine had monthly problems to solve. But I wasn't allowed to run my program until my wife found a solution manually first ;-)
I've been playing a lot with the logic programming language, Prolog. Sudoku is a popular "hello world" for it.
If you haven't used Prolog before, here's an example of a Sudoku solver. It uses Prolog's Constraint Logic Programming over Finite Domains library -- CLP(FD) -- a form of CSP.
https://swish.swi-prolog.org/example/clpfd_sudoku.pl
The relation on line 8 basically encodes the rules of Sudoku verbatim. Logic programming is cool (at least to me) because relations can be run in any direction with any number of variables.
I wonder how writing a Sudoku puzzle generator would differ in a language that had first-class support for CSP.
It would make a great dataset for benchmarking different solver approaches.
Edit: Should be fixed now.
Seems like it's fixed now though, thanks :)
Though the color of the inserted numbers and the highlight color of the current selected number are nearly the same, would be great if they were much more distinct.
Another thing I noticed is that the wrong entry highlight sometimes highlights multiple correct numbers as incorrect and some static numbers will vanish.
Before:
After:
(Also now red and orange are a bit too similar ^^, maybe introduce the color blue?)