eleven wrote:i have tried SudoRules now, but cannot find quickly, how to input sukakus (in 729 format) from a file and write the results to a file.
There is a function for solving a sukaku in 729-string format,
solve-sukaku-string:
- Code: Select all
(solve-sukaku-string "..3.5678.1.3456789123456789.23456789...4.678912.4567891234567891.34567891..45.789123. 567891.3...7..12345.7..123....891234.678912.4...8.123..6.891........12345.789123456789 1234567..12345678.123456.8912345678912345678.123.56.89123456..9123456789.23456789...4. 678912.4567891.3.567891.34567891..45.789.234567891..4.678912.456789.23..6.891234.67891 23456789123.567891.3...7.912345.789123.567891234.678912.4..78.123456.891234.6...123456 789123.56..91234567.91234..7..123456.891234.6...12345678.1234567891...5678912.45678912 345678912345678.12.45678..23.567891.3456789123456789123.567891.....7.912.45.789123..6. 891234.678912.4..78..23.567891.3...7.912345.789123.56..91234567.9123456789123456.89123 4.6...12345678.1234567891234567.912345.7..")
There's a much better function, using the much more readable list format:
solve-sukaku-list.
By default, all the results (resolution path, solution...) are printed to the standard output (Terminal / Command Window). You can change this by using the CLIPS function "dribble-on":
- Code: Select all
(dribble-on "my-file")
I still have to write in the [BUM] many things about functions for
sudokus in files; it seems I've been the only user of these functions until now:
- there are many more than the currently documented "solve-n-grids-after-first-p-from-text-file";
- in particular, there's a function "solve-n-grids-after-first-p-from-text-file-excluding" (which allows not to re-try those already solved or proven contradictory);
- there are also more specific functions for writing ratings to a file - but they are not useful when T&E is involved.
However, there's currently no function for dealing with collections of
sukakus written in a file (in either format). I could easily add this.(°)
What I have done with your patterns until now is write a special function to read your 54-string format and properly initialise the corresponding sukaku + adaptations to T&E for restricting it to candidates in the cells of the pattern. I can publish all this (as a SudRules example) if you're interested.
I don't know exactly what you want in terms of classification, but two of the main tools for collections of puzzles are global variables:
-
?*solved-list* gives you the list of puzzles that have been solved by the current set of rules (by their number in the list)
-
?*no-sol-list* gives you the list of puzzles that can have no solution (e.g. patterns proven to be contradictory with the curent set of rules/techniques)
In order to get them, just type their name and "return" when SudoRules has finished its computations.
This is all I've used for all my results reported in this thread: I select a set of rules and/or T&E and I check which patterns are proven contradictory (are present in ?*no-sol-list*). For those that do not appear in this list, I launch new calculations with more powerful rules/techniques, using function "solve-n-grids-after-first-p-from-text-file-excluding".
eleven wrote:Is it possible and can you give me additional hints for classifying these sukakus (using harder than the default rules), please ?
The only way to select which rules (or forms of T&E) you want to apply is via the
SudoRules configuration file - by adding or deleting leading semi-colons on the relevant lines (see chapter 5 of the [BUM], available in the Docs folder, for all the details). This also allows you to finely control what is printed.
In order to really understand how all this works, you need to carefully read at least chapter 5 (configuration file) and sections 1 to 3 of chapter 6 (SudoRules) of the [BUM].
*[Edit]: I've just added a few functions for this purpose. See
http://forum.enjoysudoku.com/csp-rules-sudorules-kakurules-t38200-56.html