I wrote one a while ago (loooong time, like last summer), and the problem I
ran into was that you have to make sure not to fall into endless loops. For
example, if you have two open columns, the computer might find an
infinite-move solution that involves moving card X back and forth between
the two open columns, or between both higher-order, opposite-color cards.
Other than that, the hardest part of writing a program is "teaching" it the
rules of what may and may not move.
However, the most handy technique I used was assigning each card a numerical
value, from 11 (actually 011) to 134- the first two digits being the card
value (A=1, 2-10, J=11, Q=12, K=13), and the third being the suit (1, 2, 3,
4). Make sure to keep both evens the same color, and both odds the
opposites, such as {Heart, Spade, Diamond, Club} = {1, 2, 3, 4}. That way
you can not only save space by using integers, but you can also check for
color alternation by doing a simple subtraction. If card 1 minus card 2 is
odd, then you have a red/black pair, otherwise they are either red/red or
black/black. But I'm sure everyone already knew this.
-Taren
On 6/10/05, Gary Campbell <gary_at_numin8r.us> wrote:
>
> Although I use "FreeCellPro" all the time to play freecell, I'm more
> interested in discussing freecell solving programs with people who have
> actually written a solver.
>
> Anyone who is interested in exchanging (or monitoring) information on
> this subject, please send an email to me.
>
> I would hope that not too many people have written a solver, but that
> anyone that has would join this exchange [even past masters, and even
> if only to observe].
>
> I would like to discuss programming successes, failures, designs, and
> anything else that might help us improve our own programs.
>
> -Gary Campbell
>
> ------------------------------
> *Yahoo! Groups Links*
>
> - To visit your group on the web, go to:
> http://groups.yahoo.com/group/fc-solve-discuss/
> - To unsubscribe from this group, send an email to:
> fc-solve-discuss-unsubscribe_at_yahoogroups.com<fc-solve-discuss-unsubscribe_at_yahoogroups.com?subject=Unsubscribe>
> - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>.
>
>
Received on Fri Jun 10 2005 - 18:48:33 IDT