Date: 2008-01-19 21:41:00
sudoku solver
Just for fun, I implemented a Sudoku solver entirely in Javascript. It uses Knuth's Dancing Links technique, which is an efficient way of solving "exact cover" problems (of which Sudoku is a well-known example).

This is hardly innovative—such solvers have probably been implemented thousands of times—but my implementation of Dancing Links is one of the few I've found written in Javascript. Also, my implementation exists entirely within one HTML file, so you can save it to your computer and use it to solve puzzles offline.
Vi estas mia heroo!
We made a sudoku solver in hardware (written in our functional langauge for designing hardware). We also used the solver to generate puzzles, though not very efficiently.
Oh, it was also written in a parameterized way which means we can change N=3 to N=4 and *poof* we have a 16-element sudoko solver. (Though, ours is rule-based, and even though the rules are highly abstracted -- you can write one rule and apply it to any mask of the board, like a row, a column, or a square --- while the set of rules that we wrote allows us to solve really tough 9x9 sudoku boards, it might not be so great at 16x16.)
Greg Hewgill <>