|
|
|
|||
|
Sudoku Bloggers: You might be interested in some of the blog entries on this Oracle PL/SQL Sudoku solver: Forum: Codetips: Need some help with building some Oracle PL/SQL solutions? Then these articles may be of use... 1. Dynamic SQL: A performance tuning guide. 2. Bulk Data Loading: The available approaches. 3. Report Writing: Using Oracle XML, XSL, and HTML.
|
Oracle PL/SQL Sudoku Solver - Userguide Links to algorithms 1, 2, 3, or 4, userguide, and download Installation Retrieve the zip file download and extract it into a folder of your choice. Make sure to retain the folder structure inside the zip file. Sudoku Solver To set up the Sudoku solver, run the following scripts in sqlplus:
@solver/sudoku_setup.sql -- creates tables and loads up static
data. Front End Screen The front end application developed by Patrick Barel is optional, but provides a very basic, but effective Windows frontend to the solver. To set up the additional front end screen, first the Qnxo QD runtime packages must be installed by running the following script: @qd_runtime/qda_deploy_install.sql To set up the QDA procedures used by the Delphi front end application, run the following scripts: @frontend/qda_install_all.sql In an ideal installation, the QD runtime being a common component, would be best installed in a separate schema. This would require the appropriate synonyms and grants being set up. Running The Solver Command Line Mode An Excel spreadsheet input form has been supplied to help with the input and subsequent manipulation of puzzles.. solver/suoku.xls Open up the spreadsheet and type in the puzzle into the top entry form. A unique puzzle number must be given to the puzzle, and also a brief description.
Copy and paste the insert statements generated in the right hand side box into sqlplus (or other SQL command line tool): insert into puzzles values (11,'The Times:
Fiendish',SYSDATE); The puzzle is now loaded into the staging table in the database and ready to be solved. To solve the puzzle run the following anonymous PL/SQL block command from sqlplus: begin The first parameter is the unique puzzle id entered above in the spreadsheet. The second parameter controls the amount of feedback given during the calculation. 1 - Minimal - shows summary of algorithms used
and the number of iterations. The output is via DBMS_OUTPUT, and for the most difficult puzzles it is advisable to set the serveroutput size to the maximum (1Mb). Click here to see an example output at the lowest setting. Front End Screen The front end screen is invoked by running the sudoku.exe executable in the frontend folder.
Select File from the main menu, then Logon to connect to the database. For a new puzzle, enter the puzzle id and the puzzle description into the fields annotated with the red Puzzle Header Entry label on the screenshot below. This will insert an entry into the puzzles table. Then enter the puzzle numbers into the grid annotated with the red Puzzle Entry label. This will insert the puzzle data in the puzzle_load table (as per the insert statements in the command line approach). Click on the Solve button to save the data and execute the solver. The solution is displayed in the bottom grid and the puzzle will now appear in the puzzle selection list.
To re-run previously entered puzzles, select the puzzle from the puzzle selection list and click on the Solve button. Patrick Barel: Many kind thanks to Patrick Barel at Bar Solutions for writing this front end screen using Qnxo and Delphi. Patrick was responsible for the front end screens of Steven Feuerstein's Qnxo active mentoring software product for PL/SQL. Oracle PL/SQL Sudoku Solver Oracle PL/SQL Sudoku Solver Oracle PL/SQL Sudoku Solver Oracle PL/SQL Sudoku Solver Oracle PL/SQL Oracle PL/SQL |
|
||
|
|
Send mail to webmaster@db-innovations.co.uk with questions or
comments about this web site. |
|||