Sudoku
100% hand-written · no LLMs
A Go library that solves Sudoku the way people do — and brute-forces the rest in a millisecond.
- lines written by an LLM
- 0
- AI Escargot
- ~0.4 ms
- human solving techniques
- 10
This one is 100% hand-written — no LLMs, no AI autocomplete. Almost everything else I build these days is agentic; Sudoku is where I keep the fundamentals sharp. Bit-twiddling, backtracking and puzzle logic, reasoned through and typed out the old-fashioned way.
Each cell’s candidates live in a uint16 bitmask. The brute-force solver backtracks with minimum-remaining-values
ordering and constraint propagation, solving “AI Escargot” in about 0.41 ms and “Beyond Hell” in about 1.2 ms on a
Ryzen 7 9800X3D.
The interesting half is the logical solver: ten human techniques, from naked and hidden singles through
quads and locked candidates, each returning an explained step — so it can teach, not just answer. A chainable
PeerSet query API keeps the technique code readable. Puzzle generation and grading are next, with X-Wing on the way.