Gavin’s Odd Bits of Code

2008-04-23 (Wed)

JavaScript Sudoku Solver

Filed under: Web — Gavin Brock @ 10:36 pm
Tags: , ,

Solving Sudoku with software has been rather fashionable at the office this week. So here is page that does it in JavaScript entirely on the client:

Gavin’s JavaScript Sudoku Solver

As could be expected, this is not the fastest solver in the world, but it will get there using brute force. You have an option to watch the internal decision tree or not.

Gavin's Sudoku Solver screen shot

Inspiration for the code comes from a beautiful perl three line sudoku solver by Eccles & Toad. The extremely hard test case from the list of incredibly hard puzzles strings at Sudoku Players’ Forums on sudoku.com.

Blog at WordPress.com.