Following is a discussion I had with the maintainer of GNOME AisleRiot
regarding integrating Freecell Solver with it.
Regards,
Shlomi Fish
----------------------------------------------------------------------
Shlomi Fish shlomif_at_vipe.technion.ac.il
Home Page:
http://t2.technion.ac.il/~shlomif/
Home E-mail: shlomif_at_techie.com
The prefix "God Said" has the extraordinary logical property of
converting any statement that follows it into a true one.
---------- Forwarded message ----------
Date: 05 Mar 2001 14:44:15 -0500
From: jrb_at_redhat.com
To: Shlomi Fish <shlomif_at_vipe.technion.ac.il>
Subject: Re: Freecell solver
Shlomi Fish <shlomif_at_vipe.technion.ac.il> writes:
> On 5 Mar 2001 jrb_at_redhat.com wrote:
>
> > Shlomi Fish <shlomif_at_vipe.technion.ac.il> writes:
> >
> > > On 5 Mar 2001 jrb_at_redhat.com wrote:
> > >
> > > > Hi,
> > > >
> > > > I was forwarded a mail from you by Owen Taylor.
> > > >
> > > > You wanted to add your free cell solver support into AisleRiot. While I
> > > > think this would be great in theory, it'll be a lot of work in practice.
> > > > The problem is that all the game code for freecell (and indeed all other
> > > > 56 AisleRiot games) is written in scheme. You'd need to make a scheme
> > > > wrapper around your library, and call it from the scheme code. That
> > > > being said, the freecell code is pretty crufty, and could really use a
> > > > rewrite anyway (it was the third game written for it.)
> > > >
> > >
> > > Freecell Solver has an API which is meant for those wanting to use it as a
> > > solver library for their Freecell Implementations. This API is indeed in
> > > ANSI C, but I don't suppose writing Guile bindings would be that hard. If
> > > you want I can try writing a C program that uses libguile in order to
> > > solve a Freecell board, and then send you the bindings I used. I'm not
> > > promising I'll do that anytime soon, but I can work on it on some of my
> > > spare time.
> >
> > Er, actually, I'd like to see a guile program that wraps and links to
> > your library and solves freecell from there. (-: But it's about the
> > same thing...
> >
>
> I don't understand. AFAIK, AisleRiot is a C program which links against
> libguile, and then runs the Scheme code found in the text files that come
> with the distribution. So, I have to write a similar program, which means
> a C program that runs some Scheme code.
Sorta -- but all the C code does is display cards. All the guts of the
solitaire (including the help functions) are written in scheme -- and
for a while I had a text-only interface to the scheme files that let me
play them w/o X at all. So when you want a hint, the display code calls
(get-hint) and gets a move back (or #f if the game is over).
> > If you are at all curious, you can look at what I'm doing in sol.scm
> > (and all the games) in AisleRiot. Let me know if you have problems.
> >
>
> I'll check it out. Thanks.
Cool.
-Jonathan
Received on Mon Mar 05 2001 - 22:43:40 IST