Saturday, October 16, 2010

Sudoko Solver

Wrote a small application to solve a Suduko puzzle in C#, I was doing C# coding after some years now and I thoroughly enjoyed it

If you are interested you may wont to give it a try.

Step 1: Make a grid of text boxes (81 of them !!! ), load it into an array of objects
Step 2: Write function checkRow to see if no two numbers are repeated
Step 3:Write function checkColumn
Step 4:Write function checkBox
Step 5:Write function findAllPossible(for a particular position)
Step 6:Write function findAll(for all 81 position)
Step 7: Check is their a number in a row which is allowed only in that position, then that number is to be placed there
Step 8: Check is their a number in a column which is allowed only in that position, then that number is to be placed there
Step 9: Check is their a number in a box which is allowed only in that position, then that number is to be placed there
Step 10:Do color coding for duplicates. Make new entries come in green or something

Future Enhancements : Undo, History, Game Generation, Guessing in case direct solving does not work

Time : ~15 hours of coding ..... more because there was many things I was not sure how to do in C#, because of the gap ... try it, it is fun