Douglas Woolley

# Sudoku 4.1 by Doug Woolley

My nephew Ryan got me hooked on Sudoku when he showed me his book that he was bringing on a cruise in March 2006. It seems to be the "Rubik's Cube of the 21st century." The Sudoku puzzle consists of a 9x9 grid of squares with some of the digits 1 through 9 dispersed throughout parts of the grid. The object is to place the digits 1 through 9 in all the other empty squares so that each row, column, and 3x3 sub-grid has the digits used exactly once. Since people use logic to systematically solve this puzzle, I figured that this puzzle would be a good project to program into the computer. I had been learning Visual Basic .NET 2003 during the previous month and needed a good project to put into practice the principles I had been learning. After 24 hours, I was able to put together a functional version of the Sudoku game. For the next two weeks, I had enhanced it to be a fully functional game with a graphical user interface. It also serves as a tool to solve the puzzle and was able to solve all but the hardest puzzles. On 4/19/06, I upgraded the program to use Visual Basic .NET 2005, thus the program became version 2.0 with some additional enhancements.  As of version 2.1, released on 4/27/06, the program was now able to solve all puzzles and deliver a step-by-step solution with strategies for the user! For most puzzles, the program will solve it within a second. For the hardest puzzles in the world, the program will take a few minutes, but it will also warn the user ahead of time if it will take a few moments to solve the puzzle. Version 2.2 was released on 6/29/06, and it performs an additional strategy of "guessing" between two possible digits for a cell, after all logical means have been exhausted. If the puzzle is still not solved, the program uses the author's original Brute Force method of permuting all possible digits in all cells. With the additional guess strategy, a vast majority of really tough puzzles can be solved in only one second. Version 3.0 was released on 8/12/09 as it was upgraded to run on .NET 3.5. On 12/19/2010, I converted the program (v 4.0) to use the C# language (for the .NET 3.5 framework). On 9/15/2012, I performed an internal cleaning of the code by dynamically generating the 81 textboxes and dynamically referencing them (v 4.1). An image of the program's interface with a sample puzzle is shown below:

To install the program and run it on your machine, click this link to install Sudoku v4.1 (80 KB).

Note: You will need to have .NET Framework 3.5 (or higher) on the machine.
You can install 3.5 from Microsoft (2.7 MB) (Microsoft .NET Framework 3.5)

Older versions:

You can install Sudoku v4.0 (125 KB) to run on .NET Framework 3.5.
You can install Sudoku v3.0 (149 KB) to run on .NET Framework 3.5.
You can install Sudoku v2.2 (160 KB) to run on .NET Framework 2.0.

The Sudoku program will come with only 6 sample puzzles (two that are easy and two that are quite tricky and two that are really tough).
A seventh puzzle can be selected that allows the user to enter your own puzzle to play or solve.
Further puzzles can be loaded using the File menu option, if the puzzle text files have been provided.

Further updates will be made to the program. It is interesting and challenging to improve the program.

Wikipedia Sudoku:http://en.wikipedia.org/wiki/Sudoku
Wikipedia Mathematics of Sudoku :http://en.wikipedia.org/wiki/Mathematics_of_Sudoku
Sudoku Puzzle contest: http://wpc.puzzles.com/
Mathematical proof of total number of valid Sudoku grids:http://www.afjarvis.staff.shef.ac.uk/sudoku/
(Total number of valid Sudoku grids is approximately 6.7 x 10^21, or 6.7 sextillion  -- plenty of puzzles to solve)
Sudoku web site (of Wayne Gould who popularized the game):http://www.sudoku.com