Shlomi Fish wrote:
>
> In a private discussion I had with Stephan Kulow, we discussed a method to
> prototype variants of card solitaire, so they can be loaded to a program
> and configured by the user, without having to touch the code of the
> solitaire suite itself.
>
> PySol, for example, uses a menu in which each menu item accesses a
> function which sets the current games. PySol use object inheritance
> extensively, but it requires python hacking to modify the list of games.
>
> Then there is a Solitaire suite for Windows called Pretty Good Solitaire
> (http://www.goodsol.com/) which has roughly 350 variants and also has a
> GUI wizard that allows the user to add his own Solitaire variants. I
> thought a similar functionality would be very nice in the UNIX-based
> Solitaire games.
>
> What I've been thinking about is a variant definition file which will
> enable us to set and inherit solitaire variants. The final product will
> probably (but I'm not entirely sure about it) XML, but I'm giving it here
> in C++-like syntax for clarity. In any case this is more of a DTD, so it
> can be represented in several forms.
>
> In any case, We can define Freecell like that:
>
> variant freecell inherits none =
> {
> name = "Freecell",
> type = "freecell-klondike-gypsy",
> talon = "none",
> stacks = "8",
> freecells = "4",
> decks = "2",
> sequences_are_built_by = "alternate_color",
> sequence_move = "limited",
> empty_stacks_filled_by = "all",
> init_state =
> {
> stacks="7,7,7,7,6,6,6,6"
> }
> }
>
> Then, in order to define Baker's game we need to do:
>
> variant bakers_game inherits freecell =
> {
> name = "Baker's Game",
> sequences_are_built_by = "suit",
> }
>
> Etc. We could have multiple inheritance by defining interfaces, which only
> set specific items based on their discretion. By editting this file (or
> providing the user with a facility that will edit it for him) we can have
> a rather flexible variant management.
>
> Let me know what you think.
>
You need more. You need to know the places of the piles and the rules
for
the piles. You would need to provide quite a bunch of generic algorithms
for
rules and hints if you want to get to 350. 350 different variants of
freecell
is perhaps a bit boring for the average user - even though you had
something
to learn for almost every day in the year :)
Greetings, Stephan
--
People in cars cause accidents. Accidents in cars cause people.
Received on Thu Apr 05 2001 - 03:23:00 IST