Google turns up a lot of code for sudoku solvers, so I encourage you to look into it. But to start with, you need to write a few methods to solve the puzzle based upon the rules. One method can check for entries based upon row/column/box exclusions which only allow a single number in the cell (eg you have 123450789 - you can obviously fill in 6). Another method can fill in the grid based upon the process of elimination (surrounding rows, columns, and boxes restrict the value of a certain cell - here you can calculate the possible value for each cell and only one possibility allows you to set its value). A third method can be used if neither of the two above methods sets a value, this method seeds the puzzle then lets the other methods proceed - this method should be able to backtrack should the puzzle not be solveable based upon its 'seed'.