Sign in Join
Wiki copytemporary

Sudoku: what changed

Revision 2 to 3. 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
18-`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`
18+```text
19+svn co https://svn.code.sf.net/p/lazarus-ccr/svn/applications/sudoku/ local/path/to/sudoku
20+```
1921
2022Alternatively you can view the sources through viewcv:
2123
2224<https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/applications/sudoku/>
2325
2426### Usage
2527
2628If 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.\
2729If you press the "Clean" button, the grid will be cleared.\
2830When you are finished entering the digits press "Solve" and the grid will be filled with the solution.
2931
3032If the program is unable to completely solve the Sudoku, a ScracthPad form will pop up.\
3133This form shows for each cell what possible options are left.\
3234Solved 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:\
3335
3436 |1 |
3537 | 4 |
3638 |7 9|
3739
3840In the above example, the numbers 1, 4, 7, and 9 are in the range of possibilities.\
3941
4042You can edit the grid and copy the values back to the main form, then try to solve it again.\
4143(Note: only cells that contain a single digit will be copied back to the main form.)
4244
4345The program also has the option to load and save sudoku files.\
4446A sample sudoku file is incuded in the svn repository. The file format is a simple textfile, it is explained in the sources.
4547
4648#### Example for using the ScratchPad functionality
4749
4850The sample file "*unsolvable.sudoku*" (included in the repository) cannot be solved by the program.\
4951If you load it and then click Solve, the ScratchPad will pop up.\
5052Now click on the second cell in the bottom row.\
5153An editor will pop up.\
5254The editor has 9 checkboxes. In this example the checkboxes for "2" and "6" should be checked.\
5355You can toggle a checkbox's state by either (as usual) clicking ont it, or pressing the number ("1".."9") on the keyboard.\
5456Pressing the Enter key will write back the changes to the ScratchPad, pressing Escape will discard the pop-up form.\
5557
5658![](/wiki-images/e/ef/Sudoku-scratchpad-digitset-editor.jpg)\
5759In the example, if now uncheck "6" (leave the "2") and click Ok, then click the "Copy only values back..." button.\
5860The changes are propagated back to the main form.\
5961Again click the "Solve" button.\
6062The program now **will** be able to solve the Sudoku.
6163
6264### Description
6365
6466The 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.
6567
6668So it follows these rules (taken from [WebSudoku](http://www.websudoku.com/)):
6769
6870The 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.
6971
7072### Related Sites
7173
7274[Sudoku Solver](http://sudokusolver.info/) Online Sudoku Solver Released Under The GNU public license.
7375
7476---
7577*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).*
7678Category: Example programs
7779Category: Game Development

Back to history