Years ago I wrote a sudoku solver program in C++ and found that it contained many useful concepts. Play sudoku a little by hand. Then look up (or derive for yourself) some of the common strategies. Then program them into your solver. I think I ended up with 5 strategies. It repeatedly applies the easiest one until the game is solved or the board doesn't change. Then it applies the next hardest one. If it makes progress, then it goes back to the easiest strategy again. Once the first and second don't make any progress, it moves on to the third, etc.