Re: A Sudoku solver in Tcl
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: A Sudoku solver in Tcl

From: Bernard Desgraupes <bdesgraupes@easyconnect.fr>
Date: Tue Dec 06 2005 - 11:01:06 CET

In article <slrndpag42.56k.avl@gamma.logic.tuwien.ac.at>, Andreas
Leitgeb <avl@gamma.logic.tuwien.ac.at> wrote:

> Bernard Desgraupes <bdesgraupes@easyconnect.fr> wrote:
> >> A switch to turn that off would put the script in the position
> >> of a player, ...
> > Yes I'll add such a switch, it sounds fair.
> thanks :-)
>

I's done now. There is a -n flog (for "no backtracking")

I also introduced an -s option for suggestions (obtained with any
technique) and a -p option to probe the sudoku using a particular
technique. Solving techniques are designated by a short code. For
instance brc for Block to Row/Col reduction:
    sudokut -p brc
..37..65..7.45.8..1....6..4592....4.8..9245.6.....59.23..54...77.4.9..6..
2...74..
which yields
    value 6 for block 4 can be only in row 6
         remove candidate 6 from cell (6,4)
    value 6 for block 4 can be only in row 6
         remove candidate 6 from cell (6,5)
    value 6 for block 8 can be only in row 9
         remove candidate 6 from cell (9,1)
    value 6 for block 8 can be only in row 9
         remove candidate 6 from cell (9,3)

There now remains to implement other human techniques... Currently
there is only Single Candidate (sc), Hidden Candidate (hc) and the
above brc.

> >I think I shouldn't be using the $Revision$ keyword
> > at all.
> Don't worry. Now, that it's in sf, the release numbers should remain
> consistent from now on, even when you check in another copy from your
> local cvs. If you ever intend to feed sf-versions back to your local
> cvs, just use an appropriate -k... option (the one that restores the
> checked-in values), and you'll never see anything but your local
> numbering. Anyway, remember not to start mentioning CVS-version
> strings in other files...
>
I removed the $Revision$ keyword so that there not should be
discrepancies anymore.
Received on Sun Dec 11 13:53:48 2005