Hello, I am now interested with SUDOKU games and decided to have an C++ exercise on it...
I want to try to write a C++ program that can solve some simple sudoku question. But the problem is, I can`t figure out what is the algorithm steps to solve a sudoku....anyone can help? Thanks.
Sudoku is really easy to solve computationally provided you give it "nice" inputs. I'll explain exactly what I mean by that in a minute.
Basically, after being given a starting state, you look at each square and work out at that point in completion which numbers could possibly go in that square.
When you find a square which has only one possiblity then you fill that square with the number and recalculate all the sqaures which relate to it. Keep going like this until all squares are filled.
It's not quite this simple in real life though. Sometimes you can get puzzles which will force you to guess between two (or more) possibilities for a square. When you start having to deal with this you'll have to start making "save" points where you can go back to if you discover the puzzle is unsolvable from the guess you (or the computer) made.
Similarly, it is possible to make puzzles which are unsolvable.
Thanks, I will have a look on it....