A Rexx interface for card games
The user interface without ARexx
This interface is actually for a general-purpose card playing engine.
It keeps track of stacks of cards. The stacks have single-character
names, determined by the game in question. In general, a cards can be
moved from any stack to any other stack, and the game determines how
many cards should be moved. Some stacks allow cards to be moved only
to one stack (i.e. - from the hand to the stock). Double-clicking on a
stack is treated as a request for the game to find the correct
destination for the top card for that stack. This is usually used as a
shortcut for the stack.
Nouns.
- Card - a single two-character word ([123456789TJQK][SHDC])
- Stack of cards - a string of blank-seperated words
- Stack to play on - a single character determined by the game
- The user - The only thing the user can do is move
- A move - a three word list: fromstack tostack count.
Verbs.
Stack stackname
- This returns a the list of cards in the stack as a string of
words. Facedown cards are returned as FD. The only possible error is
a stack that doesn't exist.
Move fromstack [tostack [count]]
- Moves count cards from fromstack to tostack. 0 or ALL for count
indicates all the cards. Leaving off tostack asks for the double-click
action, if supported for that stack. Extra arguments are ignored. Not
supplying required arguments is an error, as well as naming
nonexistent stacks or asking for more cards than are in fromstack to
be moved. The game in question may flag a move as illegal, which is
also an error. Returns all details of the move.
User "TEXT"
- Text is displayed for the user. The first nonblank character is
the delimiter, and is terminated by a matching delimiter. Returns the
valid move the user made. No errors are possible.
Quit [newgame]
- Resigns the current game. Any nonblank characters after the
command result in a new game starting; otherwise the game exits.
Back to thinker, or up to new designs.
Mike W. Meyer