On Saturday 26 May 2007, TinxMilis wrote:
> Hello Shlomi,
>
> Saturday, May 26, 2007, 10:41:15 PM, you wrote:
> > FreecellTool has an awful interface. Please look at Freecell Pro for a
> > much better one:
> >
> > http://www.rrhistorical.com/rrdata/Fcpro65/
> >
> >
> > You can find its source code here:
> >
> > http://fc-solve.berlios.de/don_woods.html
>
> I knew about Freecell pro, but it looks so complicated (the source code,
> because it's implement too many solver and for too many games), can you
> tell me which algorithm (solver) is the easiest to implement ? :)
>
> The Woods-Callan-Ettlinger Solver (FcPro original)
>
> Freecell Solver by Shlomi Fish
> Patsolve by Dr. Tom Holroyd
>
Well...
All three solvers are sophisticated. Patsolve is considerably shorter than my
FCS, but FCS is much more configurable and feature-rich and may yield more
interesting human-like solutions.
Patsolve's code is quite dis-organised with comments that do not make the code
much easier to understand. The code is still of high-quality. The source code
of FCS is optimised to death (including with some funky C preprocessor
macros). It is extensively documented in external documentation but this
documentation may be out-of-date. There are some comments, but not too many,
and I cannot guarantee that they were updated after the code was.
In any case, you really shouldn't implement any of this in Delphi. Just create
bindings to Freecell Solver (very doable and easy to do in Delphi). Please
don't re-invent a square wheel (and in Delphi at that).
> Actually, for your solver, what kind of input are required ? Arrays of the
> cards positions ? And it'll give us something like the one from freecell
> pro?
>
The required input is an ASCII string representation of the state. FCS parses
this string into its internal format, and then processes it. In return it
will give you an iterator, that will return one move at a time. There are
macros in fcs_move to retrieve the information for the move.
> And btw, I was looking at FreecellTool mainly because it could hook itself
> to the game window :)
>
Yes, but I don't think it can play the game for you. MS Freecell is a really
lame implementation of Freecell. While it is very popular, what introduced
the game to me and many others, and what is possibly still the most popular
implementation, it is still very bad. [1] I switched to playing Freecell
using PySol, and can never go back. Freecell-Pro
{{{{{{{{{
[1] - The popularity of something or the fact it is a de-facto standard does
not make it less bad. For example, Windows is the most popular operating
system for desktops, but it is an abomination. The only reason Linux is not
the most popular one is because everything only runs on Windows. Internet
Explorer is still the most popular browser, but see
http://www.shlomifish.org/no-ie/ .
We all know how MySpace is popular and how badly designed and an advertisement
and JavaScript-hell its pages are (or at least used to be). And there are
more examples.
}}}}}}}}}
> > And naturally, if you want to know to really know how everything, works -
> > read the source code. ANSI C is very similar to Pascal, except from a
> > few key differences in syntax mostly. You can always call an external
> > library (such as Freecell Solver) from Pascal by at most writing some
> > wrapper functions. So you don't need to implement everything yourself.
>
> Hmm, how to do that ? :D
> I tried to google it with this query "c wrapper function for pascal" is
> that right? Or maybe you have some great links for that topic?
I don't recall exactly how to do that. Ask on a Delphi forum or mailing list.
>
> > If you have access to a C compiler for Windows, such as MS DevStudio, GNU
> > gcc (an excellent, freely available, open-source one), or Borland C++,
> > then you can easily build Freecell Solver (or any other Freecell-solving
> > library and use it). The source code and binaries for Freecell Solver are
> > available under the Public Domain, and as such have no restrictions
> > whatsoever on their use.
>
> I got your freecell solver source code. I'll try to understand how it's
> work tomorrow :D
>
> Jeez, I guess my brain doesn't work as good as it was anymore since it's
> been 4 years since the last time I wrote a program :D
>
4 years... :-)
> Anyway. Thanks heaps!
>
Binary heaps, binmial heaps or (heavens-forbid) fibonacii heaps? ;-)
http://en.wikipedia.org/wiki/Heap_(data_structure)
Regards,
Shlomi Fish
---------------------------------------------------------------------
Shlomi Fish shlomif_at_iglu.org.il
Homepage:
http://www.shlomifish.org/
If it's not in my E-mail it doesn't happen. And if my E-mail is saying
one thing, and everything else says something else - E-mail will conquer.
-- An Israeli Linuxer
Received on Mon May 28 2007 - 00:23:41 IDT