Hi Danny,
On Fri, 07 Dec 2012 18:44:01 -0000
"dannyjones183" <dannyjones183_at_yahoo.com> wrote:
> To me, using pseudo-C forces a constraint that isn't natural. I think all of
> your {0..N-1} statements should be {1..N}. That way, I would have a clearer
> idea what move "m" from column "col" to freecell "fc" using deck "j" actually
> means. I don't care if my input/output modules have to do a little extra
> work. Better them than me!
OK, but remember that this is an interchange format. Assuming the solution
format is valid, then one can easily convert it to a one based on format using
an XSLT transformation or whatever. Furthermore in XML and JSON the index in the
sequence is normally not given or needed, so the starting index is irrelevant
(unless it is referenced).
Another thing I've considered is how to represent PySolFC-like saved games
with undos and redos and tree diversions. I don't know whether it falls in the
scope.
Also see
http://bikeshed.com/ .
Regards,
Shlomi Fish
>
>
> --- In fc-solve-discuss_at_yahoogroups.com, Shlomi Fish <shlomif_at_...> wrote:
> >
> > 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:
> >
>
> <snip>
>
> > ---------------------
> >
> > 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/
What does "Zionism" mean? - http://shlom.in/def-zionism
The difference between a good student and a bad student is that a bad student
forgets the material five minutes before the test, while a good student five
minutes afterwards.
— One of Shlomi Fish’s Technion Lecturers
Please reply to list if it's a mailing list post - http://shlom.in/reply .
Received on Fri Dec 07 2012 - 23:06:14 IST