Paquita wrote:Yes I know I can use SudoRules. I think I figured out how to give a file with puzzles as command line argument, but then I have another question : is there a way to redirect the output to a file?
The general way for this is
- Code: Select all
(dribble-on "full_path_to_your_file")
. All output is redirected to your_file.
- Code: Select all
(dribble-off)
will redirect the output to the Terminal.
Paquita wrote:Right now when I use it I get output, but when I do more puzzles I have to scroll in the Clip window to see the output per puzzle. You also mentioned the result is in a variable but I don't know how to ask for its value in Clip, even for a single puzzle, let alone when I process a file of puzzles.
When you solve puzzles in string format in a file, at the end, global variable ?*solved-puzzles* contains the list of line numbers whose puzzles have been completely solved.
Let's say you have selected ?*TE2* as the only technique to be applied (and therefore de-selected the default rules in the config file).
- Code: Select all
(solve-n-grids-after-first-p-from-text-file "my_puzzles_file" p n)
will solve the n puzzles after skipping the first p.
At the end, global variable ?*solved-puzzles* will contain puzzles solved in T&E(2) (and those solved in T&E(1) or T&E(0), if any).
To get this list, merely type:
- Code: Select all
?*solved-puzzles*
and return/enter.
Note that if you want to get the exact T&E-depth, you have to run T&E(1), T&E(2) and T&E(3) separately.
But if you only want to exclude puzzle in T&E(3), running T&E(2) is enough.
One more useful function is "not-in-list$"
Suppose, as before, you got a list of puzzles in at most T&E(2), where total file length is n.
- Code: Select all
(not-in-list$ ?*solved-list* n)
will give you the line numbers, up to n, of those that are not in T&E(2).
[Edit]: if you don't want to see all the details of the T&E calculations, type the following,g before launching function solve-n-grids...
- Code: Select all
(bind ?*print-actions* FALSE)
(bind ?*print-RS-after-Singles* FALSE)
(bind ?*print-RS-after-whips[1]* FALSE)
(bind ?*print-solution* FALSE)
(bind ?*print-final-RS* FALSE)
(bind ?*print-hypothesis* FALSE)
PS. To avoid hijacking this thread, if you have more questions about SudoRules, it's better to ask in the CSP-Rules... thread (
http://forum.enjoysudoku.com/csp-rules-sudorules-kakurules-t38200.html).
.