Live data from Hacker News

Learning from Sudoku Solvers (2007)

ravimohan.blogspot.com

1–9 of 9 posts

Re: Learning from Sudoku Solvers (2007)

#5
post #2

Some comments 2 months ago (15 points, 7 comments) 2012 (28 points, 9 comments) https://news.ycombinator.com/item?id=4434744 2010 (65 points, 48 comments) https://news.ycombinator.com/item?id=1221399

The one from a couple months ago is here: https://news.ycombinator.com/item?id=45733410

Re: Learning from Sudoku Solvers (2007)

#6

Or perhaps just use a language that's designed to solve those sorts of problems? In 14 lines of code. https://www.swi-prolog.org/pldoc/man?section=clpfd-sudoku

Is there a similarly short/simple solution not using all of the built ins? Haven't worked with prolog in a while but should be easy enough with primitives (albeit with more duplication)?

Re: Learning from Sudoku Solvers (2007)

#8
I remember implementing some of these

https://www.stolaf.edu/people/hansonr/sudoku/12rules.htm

With a simple array of unsigned int and bit operations like 20 years ago. It could solve a lot of puzzles within microseconds. Later I realized rules 1, 2, 5, 6 are pretty much the same.

Re: Learning from Sudoku Solvers (2007)

#9
post #6

Or perhaps just use a language that's designed to solve those sorts of problems? In 14 lines of code. https://www.swi-prolog.org/pldoc/man?section=clpfd-sudoku

Is there a similarly short/simple solution not using all of the built ins? Haven't worked with prolog in a while but should be easy enough with primitives (albeit with more duplication)?

Well no, not really. The whole point is to use the appropriate tool for the task at hand. In this case it's the CLP(FD) library, https://www.swi-prolog.org/pldoc/man?section=clpfd