[pm-h] Sudoku

Mike Flannigan mikeflan at earthlink.net
Tue Feb 14 06:19:23 PST 2006


Paul Archer wrote:

> I doubt it would take that long. A human can solve even a hard one in less
> than 20 minutes. Check out www.websudoku.com to play some.
>
> I figure the easiest way to solve a puzzle (from a programmatic point of
> view) is to mark all the possibilities for each square. Then, for the
> squares that only have one possibility, mark them as final. Then remove that
> number from the other squares. Repeat as necessary.
>
> Paul

Sounds good.  Then when the square with the lowest possible
options has 3 numbers, pick one and store the other 2 (all numbers
for each square) as whole other games to be played after running
all possible combinations of the current game.  So you are building
up an array of arrays, each items being another game starting point
to add to the possibilities of the running game possibilities.  Of
course each of these other games may spawn other array of arrays
of future games to play.  I guess you could just append those to
the primary array of arrays and only have one.

Now if sounds kinda easy.  Just have a printout that prints the
number of records in the array of arrays and the number of games
that have been completed to show your progress.

If I know you Paul, you've already got something going on this.


Mike




More information about the Houston mailing list