Thursday, July 7, 2011

Sudoku Solver - The GUI (Part 3 of 4)

[This post is a part of the main post - Sudoku Solver with GUI written in python.]

The Sudoku Solver has a simple and easy to use GUI.
Lets us go through the picture gallery to understand it well -

#1. Startup
This is how the Sudoku Solver looks when you start it -

Picture #1
Note the maze-like colour combination for easy identification of the (specific) 3 x 3 boxes. Also, in the side pane, you have a big white coloured (initially empty) Solution Box and 4 buttons - Save, Clear, Revert, Solve.

#2. Entering numbers -
To enter numbers in the cells, you need to just scroll over the cells. Scrolling over a cell will rotate through its permissible numbers. (Permissible numbers are those numbers which you can enter in the cell without immediately violating the Sudoku rules. The rules may later get violated.)

For example, consider this puzzle -

Picture #2
Observe that for cell 5,5 {row 5, column 5}, the permissible numbers are 1,4,5 and 6. So you can scroll on cell (5,5) to rotate through these numbers (only). You cannot enter any other number in that cell. Thus, the mechanism is such that it automatically prevents you from committing any mistakes while filling the grid.

Picture #3 (Observe the cell (5,5) for each case.)
#3. Save, Clear, Revert -
You can save a puzzle you have entered in the grid using the Save button.
Use the Clear button to clear the grid (and make it again look like Picture #1 above).
To load an already saved puzzle (the one saved using the Save button), use the Revert button.

#4. Solve and the Solution -
Once you have entered a puzzle, click Solve to solve the puzzle. The puzzle will be solved almost immediately. You can go through the solution (steps taken to solve the puzzle) in the Solution Box

Picture #4
Picture #5

(Completely understanding the solution from the Solution Box is not easy and may take time. You will understand it better if you have gone through this post - How To Solve A Sudoku?)


Don't worry if you forget any of the above. You can get these instructions in the Sudoku Solver application too - In the menu bar, simply go to Help -> How To Use?

(In the above pictures you cannot see the menu bar, because these screen shots are from Ubuntu 11.04 in which the application menu bar is integrated with the global menu bar at the top.)

#5. Additional -
You can make the application span the entire screen using F11 (or from the menu bar, View -> Fullscreen.)
Picture #6

Also, when the mouse moves into the region of a (non empty) cell, the number within pops up. This can be noticed in the above picture too.

No comments:

Post a Comment