sudoku solver is a Java application that can solve square sudoku puzzles of any size (where the width or height of the puzzle is a perfect square). The solver tries all possible combinations until it finds a solution. The program attempts to solve the puzzle quickly by following a strategy where it always fills in cells that have the fewest choices associated with them before filling in other cells.

Using the Sudoku solver:

  1. Get a compiled version of the program by either...
    • Downloading the .class files in the directory called "precompiled"
    • Downloading SudokuBoard.java and compile it yourself by running the command "javac SudokuSolve.java".
  2. Create a text file for the puzzle you wish to solve. Use 'x' to indicate empty cells. Non-empty cells must contain numbers from 1 through size---where size is the width or height of the puzzle. Note that size must be a square number. size is 9 for traditional Sudoku puzzles. Two test puzzles are provided for you to try.
  3. Run the solver on the puzzle with the command "java SudokuSolve size puzzle-file.txt". The program repeatedly prints out the status of the board until it finds a solution. It can usually solve 9x9 Sudoku boards in a few seconds.

Download Sudoku solver