Send to a Friend

LostInParadise's avatar

Any suggestions for my sudoku solving computer program?

I just started looking at sudoku puzzles and wrote a program to try to solve them. The algorithm is fairly simple.

For each square, find the possible values that it can have based on what row, column and box it is in. If there is only one remaining value then use that number. This part is a generalization of the idea of adding to a row, column or box that has one missing value.

If there is more than one possible value, then for each value, check to see if there are no other members of the row, column or box that can use it. If that is the case then assign that value to the square.

After all the squares have been examined, start over again and keep doing passes until no more changes are made.

I tried this on a puzzle that was listed as moderately difficult, and the program solved it. I suspect that the program will not be able to solve expert level programs, but I will give it a try when I get the chance.

I can’t think of any way of improving the algorithm. Any ideas?

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.

Mobile | Desktop


Send Feedback   

`