Douglas Woolley |
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). Older versions: You can
install
Sudoku v4.0 (125 KB) to run on .NET Framework 3.5.
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). Further updates will be made to the program. It is interesting and challenging to improve the program. Favorite Sudoku Links: Wikipedia Sudoku:http://en.wikipedia.org/wiki/Sudoku
|
Doug's Books |
|
© Douglas Woolley. All rights reserved. | Designed by Douglas Woolley |