Nonet
- 1 Devlogs
- 10 Total hours
A from-scratch Sudoku solver + generator written in pure Rust with an animated solve you can watch
A from-scratch Sudoku solver + generator written in pure Rust with an animated solve you can watch
Spent the weekend on nonet, a small Sudoku engine in Rust. Two halves:
• a solver using the MRV heuristic (always branch on the cell with the fewest candidates) — even the “world’s hardest” boards fall basically instantly
• a generator that produces puzzles with exactly one solution: fill a random complete grid, then dig cells back out, only keeping a removal if the puzzle is still unique
The fun part is it shows its work — an animated terminal UI where you watch numbers go down in green, dead ends back out in red, and the grid resolve to a single answer. The same engine is compiled to WebAssembly so you can mess with it in the browser.
Hardest bit: the generator. Naively pulling clues out leaves puzzles with multiple solutions; the uniqueness check (count solutions but stop at 2) is what keeps them honest.
Proud of: the core has zero dependencies — own xorshift RNG, own bit-masking for candidates — and the whole search animates smoothly at 60-odd steps a second.