You are browsing as a guest. Sign up (or log in) to start making projects!

Nonet

  • 1 Devlogs
  • 10 Total hours

A from-scratch Sudoku solver + generator written in pure Rust with an animated solve you can watch

Ship #1

What I made: nonet is a Sudoku solver and generator written from scratch in Rust — the point is you can watch it think. It solves any board with backtracking guided by the MRV heuristic (always branch on the cell with the fewest candidates), and generates fresh puzzles guaranteed to have exactly one solution. The default mode is an animated terminal UI where numbers go down in green, dead ends back out in red, and the grid resolves live. The same engine is compiled to WebAssembly so it runs in the browser too.

What was challenging: the generator. Naively pulling clues out of a finished grid leaves puzzles with multiple solutions, so after every removal it re-counts the solutions (stopping at 2) and puts the cell back if the board is no longer unique — that uniqueness check is what makes them real Sudoku instead of guessable mush.

What I'm proud of: the core has zero dependencies — my own xorshift RNG, my own bitmask candidate logic — and even "world's hardest" boards solve in microseconds while still animating smoothly. It's also published on crates.io.

How to test it: https://alexandergese.github.io/nonet/ — generate a puzzle, hit solve, watch it animate. Or cargo install nonet and run nonet for the full terminal UI (space = play/pause, n = new, 1–4 = difficulty).

  • 1 devlog
  • 10h
  • 10.72x multiplier
  • 107 Stardust
Try project → See source code →
Open comments for this post

10h 13m 7s logged

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.

0
0
2

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…