Writing a Sudoku solver is a slightly tricky but reasonably straightforward problem. Here I'll present a non-obvious way of implementing it which is short in terms of lines of code and also much easier to modify and extend than the more direct approaches. The general technique is applicable to a very wide range of problems, so hopefully someone
(
Read more... )
Comments 9
Reply
Reply
(The comment has been removed)
Reply
Reply
It turns out that you need 4 or 5 tables and as many (very simple) queries to populate them with data. Once you've done that, it's just a repetition of two queries to iteratively solve the puzzle.
The students always have fun with it, even though they are disappointed to see how easy it is.
Reply
Reply
Reply
Leave a comment