Sign in Join
Wiki copytemporary

Sudoku: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11### About
22
33There is very little to tell about this program. It is just an attempt to make a program which solves Sudoku puzzles.
44
55### License
66
77See the sources. I just hope it is a useful demo. Useful as in you can learn something from it.
88
99### Author
1010
1111Matthijs Willemstein\
1212Modifications by Bart
1313
1414### Download
1515
1616The sources can be found at the Lazarus-CCR repository and can be obtained via svn:
1717
1818`svn co `[`https://svn.code.sf.net/p/lazarus-ccr/svn/applications/sudoku/`](https://svn.code.sf.net/p/lazarus-ccr/svn/applications/sudoku/)` local/path/to/sudoku`
1919
2020Alternatively you can view the sources through viewcv:
2121
2222<https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/applications/sudoku/>
2323
2424### Usage
2525
2626If you run the program you will see a grid, and two buttons. If you press the "Edit" button, you are able to edit the grid and place the numbers in the grid according to your puzzle.\
2727If you press the "Clean" button, the grid will be cleared.\
2828When you are finished entering the digits press "Solve" and the grid will be filled with the solution.
2929
3030If the program is unable to completely solve the Sudoku, a ScracthPad form will pop up.\
3131This form shows for each cell what possible options are left.\
3232Solved cells will contain a single number, unsolved will have a range of possibilities, shown as commaseparated values enclosed in brackets, arranged in rows of three:\
3333
3434 |1 |
3535 | 4 |
3636 |7 9|
3737
3838In the above example, the numbers 1, 4, 7, and 9 are in the range of possibilities.\
39-\
39+
4040You can edit the grid and copy the values back to the main form, then try to solve it again.\
4141(Note: only cells that contain a single digit will be copied back to the main form.)
4242
4343The program also has the option to load and save sudoku files.\
4444A sample sudoku file is incuded in the svn repository. The file format is a simple textfile, it is explained in the sources.
4545
4646#### Example for using the ScratchPad functionality
4747
4848The sample file "*unsolvable.sudoku*" (included in the repository) cannot be solved by the program.\
4949If you load it and then click Solve, the ScratchPad will pop up.\
5050Now click on the second cell in the bottom row.\
5151An editor will pop up.\
5252The editor has 9 checkboxes. In this example the checkboxes for "2" and "6" should be checked.\
5353You can toggle a checkbox's state by either (as usual) clicking ont it, or pressing the number ("1".."9") on the keyboard.\
5454Pressing the Enter key will write back the changes to the ScratchPad, pressing Escape will discard the pop-up form.\
55-\
55+
5656![](/wiki-images/e/ef/Sudoku-scratchpad-digitset-editor.jpg)\
5757In the example, if now uncheck "6" (leave the "2") and click Ok, then click the "Copy only values back..." button.\
5858The changes are propagated back to the main form.\
5959Again click the "Solve" button.\
6060The program now **will** be able to solve the Sudoku.
6161
6262### Description
6363
6464The programs solves all Sudoku puzzles that can be solved by logic. It will not solve the puzzle where you need to guess for a solution.
6565
6666So it follows these rules (taken from [WebSudoku](http://www.websudoku.com/)):
6767
6868The rules of Sudoku are simple. Enter digits from 1 to 9 into the blank spaces. Every row must contain one of each digit. So must every column, as must every 3x3 square. Each Sudoku has a unique solution that can be reached logically without guessing.
6969
7070### Related Sites
7171
7272[Sudoku Solver](http://sudokusolver.info/) Online Sudoku Solver Released Under The GNU public license.
7373
7474---
7575*From the Free Pascal wiki, page "Sudoku", as it stood on 2020-01-10 after a change by Bart, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
7676Category: Example programs
7777Category: Game Development

Back to history