SudokuShow - This program creates and displays Sudoku puzzles, and allows the user to fill in the puzzle and to check the solution. Here's how you play: Click on the white squares to change them. When you do, a window will come up showing you the numbers 1 through 9. Pick the number you want and it will appear in the box. Click File->Check to see if you've got the right answer. Remember, the rules of Sudoku are: Each column, row, and 3x3 box must have the numbers 1 through 9 exactly once. You can create a new puzzle by selecting File->Generate. You will be asked what difficulty you want. Documentation: USAGE: perl SudokuShow.pl [-t] [-t]: include this switch to activate testing mode, where tests will be run and their results displayed. [Seed file]: the name of the file containing the seed sudokus. If omitted, it defaults to "Seeds.txt". The seed file must be organized as follows: *The file must be at least 84 lines long. Any lines past 84 will be ignored. *The file is organized in 4 blocks of 21 lines. *Each block represents a Sudoku/Answer combination of increasing difficulty. The first block is designated easy, then medium, hard, and very hard. *The first, second, and twelfth line of each block are reserved for comments or headers and are ignored. *The rest of the lines in each block must each contain 9 numbers between 0 and 9, separated by a single space. *Lines 3 through 11 represent the puzzle, with 0 signifying a blank. *Lines 13 through 21 represent the solution, with no 0s. Version History: Since 1.0.1 Release: * The code has been further cleaned up and tweaked to conform to API specifications. * The documentation has been further refined and corrected. Since 1.0.0 Release: * Testing has been added. * The documentation has been refined, corrected, and expanded. * The code has been cleaned up. Since 0.5.0 Beta: * More inline documentation has been added, as well as an inline API. * Old unused code has been removed. * Argument passing has been streamlined. Since 0.4.1 Beta: * A new difficulty, Very Hard, has been added. Since 0.4.0 Beta: * The program now reads multiple sets of puzzles and answers from a single file. * The program now uses different seeds based on the selected difficulty. * The program now refreshes the puzzle state between regenerations. Since 0.3.0 Beta: * The program now reads both the puzzle and solution from a single file. Since 0.2.0 Beta: * The generator function now regenerates the puzzle with a new permutation. Since 0.1.2 Beta: * Shuffle and randomize functions have been added to allow for permuting of puzzles. Since 0.1.1 Beta: * The fixed cells are now also buttons, but with no functions associated, making them the same size as the blanks. Since 0.1.0 Beta: * The buttons are now a different color from the labels. * The buttons now bring up a dialog that allows editing. * The check function now runs when expected and displays a dialog. * Because cell altering and puzzle checking are now operational, it is now possible to solve puzzles. * A generate option has been added to the menu. Since 0.0.4 Alpha: * The program now reads a puzzle and an answer from two text files specified as arguments. * The program displays blanks as buttons. * The program can check the puzzle against the answer for correctness. Since 0.0.3 Alpha: * The program now looks for the file sudoku.txt and reads a completed sudoku from it. * The program also displays that sudoku as a grid of labels in the main window. Since 0.0.1 Alpha: * The program displays a window with file and help menus. * The file menu contains a working quit button. * The help menu contains version and about windows that open descriptive dialog boxes. API: sub build_window # Usage: build_window(). It extracts a sudoku from the seed matrix based on the global difficulty, then sets up the window and calls for the buttons and the menubar. sub build_box # Usage: build_box(Display value, position y, position x). Creates a button displaying the value, or blank and editable if value is zero, then attaches it to the grid at [y][x]. sub build_menubar # Usage: build_menubar(). It assembles a help and file menu and attaches them to the SudokuShow window. sub check # Usage: check(). Checks the global Sudoku matrix against the global Answer matrix, and informs the player of the result. sub alter # Usage: alter(New value, index i, index j). Replaces the [i][j] element of the Sudoku global matrix with the provided value. sub generate # Usage: generate(). Queries the user for the difficulty level of the new puzzle and then creates that puzzle, deleting the current one. sub shuffle # Usage: shuffle(). Randomly permutes the global Sudoku and answer matrixes in unison to produce a valid new puzzle. sub randomize # Usage: randomize(Array reference). Randomly permutes the passed array in its current location.