3 ms·
I can't understand how you can be happy using ~84,000,000 clock cycles to solve that. Logic programming is a wonderful tool to know about, and armed with that
by Jabbles 13y ago
I can't understand how you can be happy using ~84,000,000 clock cycles to solve that.
Logic programming is a wonderful tool to know about, and armed with that knowledge you can adapt your programming style to the problem in question. http://norvig.com/sudoku.html http://norvig.com/sudoku.html
- swannodette 13y agoI love that Norvig post and it's what inspired me to get the finite domain functionality into core.logic. I don't really understand your point though. Why solve finite domain problems by hand if a library does it for you? The sudoku problem can be solved in many fewer lines of code than Norvig's http://norvig.com/sudopy.shtml http://norvig.com/sudopy.shtml with a library and it's just as efficient if not more so, http://gist.github.com/swannodette/5736688 http://gist.github.com/swannodette/5736688
- wslh 13y agoLook at my comment linking to the Z3 sudoku solver: https://news.ycombinator.com/item?id=5846589 https://news.ycombinator.com/item?id=5846589