Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A JavaScript Sudoku Solver (lisperator.net)
3 points by todsacerdoti on Jan 4, 2022 | hide | past | favorite | 1 comment


You might also be interested in my sudoku solver from 10 years back: https://dancing-links.herokuapp.com/.

I implemented it using dancing links, and applied the same code to solving polyonimos too. It was a fun exercise. Code is here: https://github.com/kybernetikos/dancing-links.

For comparison, the 'really hard' puzzle is

...8.1..........435............7.8........1...2..3....6......75..34........2..6..

And the 'harder' puzzle is

..39.....4...8..36..8...1...4..6..738......1......2.....4.7..686........7.....5..

If you're interested in the timings, you can type

    console.time();solutions=sudokuSolver.solve("..39.....4...8..36..8...1...4..6..738......1......2.....4.7..686........7.....5..", 20, 1000);console.timeEnd();
into the console.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: