Last Update:
2017-Sep-13

I support the FairTax!
FairTax.org
Find out why.

Sudoku Buster - Solve any Sudoku Puzzle
What is Sudoku Buster?

Sudoku Buster is a computerized Sudoku puzzle solver. I wrote it for fun.

Where can I get Sudoku Buster?

You came to the right place. Sudoku Buster can be downloaded right here:

  Sudoku Buster Version 1.0.0 (1.29 MB)

It is distributed in the form of a Microsoft Installer Script (.msi file).

What are the system requirements?

I developed and tested Sudoku Buster on Windows XP, but it should run on Windows 95 or later. If you have trouble installing or running the application, please feel free to contact me. (See below for contact information.)

How do I use Sudoku Buster?

First, you need to load a puzzle. There are two ways to do that:

  • Load it from a file, using the "Load from File" button.
  • Enter the starting values manually, using the "Enter Manually" button.

If you choose to manually enter a puzzle, you can then save it to a file that you can load later.

If you want to manually create input files, you can do this also. They are just text files that can be edited with Notepad or other text editor. The file format is quite simple and described below.

Once the puzzle is loaded, you can ask Sudoku Buster to solve it by pressing the "Solve" button. The board will animate the solvers actions as it proceeds. It's hard to follow at full speed, so you can choose to delay the solver a bit using the "Animation Delay" setting. This value, specified in milliseconds, specifies how long the solver will wait between "moves." The default delay is 20 milliseconds, and the maximum is 2000 milliseconds (two seconds).

In addition, the solver produces sound effects on three occasions:

  • When it makes a guess (more on guessing below),
  • When it discovers that a guessed value is incorrect, and
  • When it solves the puzzle.

You can disable these effects with the "Sound" checkbox.

What do the colors mean?

Cells on the board are color-coded based on how they were assigned.

Starting Cell Starting cells have dark gray text on a light gray background.
Assigned Cell Assigned cells have black text on a cream background.
Guessed Cell Guessed cells have dark blue text on a light blue background.

Currently, you cannot change these colors. Perhaps in a future release.

How about some screenshots?

I'm so glad you asked. A picture is worth a thousand words.

Here is the manual entry screen:

Manual Entry

I have entered evil puzzle #1,120,835,260 from WebSudoku.com.

Each cell can contain a single numeric digit from zero through nine. A zero indicates an "empty" cell, but it's easier and recommended that you simply leave such cells blank.

Per standard Windows behavior, you can advance to the next cell with the TAB key, but you can also use the arrow keys (up, down, left, right) to navigate between cells. You may find this easier.


Here is what the board looks like after it has been loaded (either manually as shown above or from a file) but before it has been solved:

Puzzle Loaded

Note that most cells are blank, and the starting cells are easy to identify.

It's worth mentioning at this point that the main Sudoku Buster window is resizable, and the board will resize right along with it, always maintaining a square aspect ratio. Of course, the other controls (buttons, etc.) will also be repositioned and resized appropriately.


One final screenshot; here is the solved puzzle:

Puzzle Solved :-)

As you can see, Sudoku Buster had to guess on four cells -- (1,2), (1,7), (2,5), and (2,9). The remaining cells were forced assignments.

How does Sudoku Buster solve the puzzles?

Writing an algorithm to solve a puzzle or play a game often involves logic that is completely different from that which a human would use. And this solver is no different. When I solve Sudoku puzzles myself, I never guess. But guessing is a major factor in the solver's algorithm.

First, Sudoku Buster assigns cells that are forced (i.e., they can only contain one value). If the puzzle is not solved after doing this, it remembers what the board looks like, picks a cell, and guesses that the cell contains one of its two or more possible values. It then repeats the process of making forced assignments and guessing. Note that it is common in more difficult puzzles to reach several levels of guesses.

Eventually, Sudoku Buster will encounter one of the following situations:

  • The board is full and thus solved (yay!).
  • The board is invalid (i.e., there is a cell with zero possible values).

The second situation indicates that one of the previous guesses was incorrect. Sudoku Buster will revert the board to the state prior to the previous guess and pick another value for that cell. If there are no more possible values, it indicates that an earlier guess was incorrect, and Sudoku Buster will back up again and revisit that guess.

Computer scientists call this a depth-first tree search.

What is the file format?

The text file format is quite simple. The first line identifies the file as a Sudoku Buster file:

  #! SudokuBuster
          

Subsequent lines represent the nine rows of the board, and each line should contain nine values -- one for each column. Blank lines and extra spaces are ignored. An example file is shown here:

  #! SudokuBuster
  
  4 0 1  2 0 0  0 0 8
  5 0 0  0 3 1  4 0 0
  0 0 0  0 0 0  0 0 0
  
  1 6 3  7 0 2  0 9 0
  0 0 2  0 0 0  6 0 0
  0 4 0  6 0 9  3 1 2
  
  0 0 0  0 0 0  0 0 0
  0 0 5  4 2 0  0 0 3
  7 0 0  0 0 3  8 0 6
          

Technical note: an earlier DOS-only version of this program was called Wasabi Buster (since I was introduced to the game on Boxerjam.com, and they call their version Wasabi). At that time, the first, identifying line was:

  #! WasabiBuster
          

For backward compatibility, such files will still be accepted, but please use the new name if you create files manually.

What if I have more questions?

Feel free to contact the author at SudokuBuster [at] scheif.net.

Page generated in 0.014 second(s).