Hi all,
in order to get the issue of creating a new standard notation for Freecell and
similar variants of Solitaire, I have started working on a new specification
here:
https://bitbucket.org/shlomif/fc-solve/src/4687c00c87ff1bed9f6c84b8ce101c0ce35159d0/fc-solve/docs/new-universal-solitaire-solutions-standard-format-proposal-v0.1.txt?at=master
(Short URL :
http://is.gd/tujNNe ).
You can find the latest version by playing with the controls and send me
patches, pull requests, etc. (though the size of the fc-solve repository may
encourage me to split it into a separate repository hosted separately).
I am including it here below for your comments.
Note: this is intended primarily as an interchange format where solutions will
be converted to and from it, and the authors of various solvers may opt to
adopt a somewhat different format .
Changes from last time are the inclusion of the optional "comments" for moves.
I have also noticed that the specification is quite Freecell-centric and that
some of the assumptions may require adaptations for other types of Patience.
Also, please voice your comments now before I start working on XML and
JSON/Perl-5-like data structures representations of this format. Even if this
proposal seems fine to you as it is, please note it.
Regards,
Shlomi Fish
---------------------
Abstract
--------
This is a proposal for a universal format for encoding solitaire solutions.
It grew out of a discussion on the fc-solve-discuss mailing list based on
some people's frustration with the so-called “standard notation” for
notating Freecell.
This standard is written in a pseudo-BNF / pseudo-C-struct format, which
will be encoding agnostic and can later be encoded in XML, JSON or a more
human-readable format (though conversions to this format will be explicitly
specified.).
Format:
-------
Rank = {Integer: from 0 to MAX_RANK } (MAX_RANK is normally 13 for French
playing card, but is specified at the header).
Suit = One Of{'H','C','D','S' }
Deck = {Integer: from 0 to NUM_DECKS - 1 }
Card = {
bool is_empty;
bool is_hidden;
Rank rank;
Suit suit;
Deck deck; # Optional
}
Column = {
int len;
Card cards[0 .. len-1];
}
Foundation_Id = { Deck deck, Suit suit }
Foundations = {
Map : from Foundation_Id to Rank.
# For all decks and suits
}
Freecells = {
Array of NUM_FREECELLS cards that can be empty.
}
GamePosition = {
Foundations foundations;
Freecells freecells;
Column x NUM_COLUMNS;
}
Column_Idx = {Integer: from 0 to NUM_COLUMNS-1 }
Freecell_Idx = {Integer: from 0 to NUM_FREECELLS-1 }
Source_Or_Dest_Id = union {
Column_Idx col;
OR
Freecell_Idx freecell;
OR
Foundation_Id foundation;
}
Move = Struct {
Source_Or_Dest_Id source;
Source_Or_Dest_Id dest;
int num_cards; # Where appropriate;
Card source_card; # Optional
Card dest_card; # Optional
bool implicit; # Whether this move is done implicitly by an automove.
}
Move_With_Position = Struct {
GamePosition pos_before_move;
Move move;
}
Solution = {
Move_With_Position moves[0 .. NUM_MOVES - 1];
GamePosition final_position;
}
Header = {
int NUM_DECKS;
int NUM_MOVES;
int NUM_COLUMNS;
int MAX_RANK;
String variant; # such as "freecell", "bakers_dozen", "bakers_game", etc.
enum sequences_are_built_by {
RANK, SUIT, ALTERNATE_COLOR
}
enum empty_stacks_filled_by {
KINGS_ONLY, NONE, ANY_CARD,
}
enum sequence_move {
LIMITED, UNLIMITED
}
}
Total = {
Header header;
Solution solution;
}
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Best Introductory Programming Language - http://shlom.in/intro-lang
Beliefs are what divide people. Doubt unites them.
— http://en.wikiquote.org/wiki/Peter_Ustinov
Please reply to list if it's a mailing list post - http://shlom.in/reply .
Received on Fri Dec 07 2012 - 03:20:19 IST