Patience-1.8(6)

NAME
Patience --- a solitaire game for those with plenty of it

Introduction
What is so special about this solitaire game? There are six different sets of rules according to which the cards can be laid. It is possible to `undo' an unlimited number of moves (in the extreme case, all moves back to the beginning of the game). The current state of the game can be stored and loaded again at a later point - perhaps the game will come out better then. Suggestions for possible moves can be made if requested. You can play in a kind of battle solitaire against the computer or against another player (perhaps on a remote host). If it is already clear that the game will come out, there is no need for tedious marathon clicking; the program will independently distribute all the cards to the piles. Those who really want to can cheat. A demonstration (for each set of rules), which gives a rough idea of how the game could be solved, is available. The cards - a French deck - are displayed on a playing field of size 640*400 screen pixels, but there are also a few other card fonts available. One font in Gif format for displaying card with multiple colors exists also. The whole thing is programmed in Tcl/Tk, so it can be installed on any computer with tcl7.4 and tk4.0 (or tcl7.3 and tk3.6) in about 10 seconds. There is a rule editor with which new sets of rules can be compiled (and stored); these new games can then be played in addition to the six games provided. The program is localized; dependent on a resource there is a german or english user interface. tkman will be used as browser of the help text, if it is running on the current display.

Rules

  The cards
All games of Patience, regardless of the other rules, are played with bridge cards. A deck consists of 52 cards: the numbered cards from 2 to 10, the Jack, Queen, King and Ace, each in the suits Diamonds, Hearts, Spades and Clubs. Depending on the set of rules used, the game is played with one or two decks, i.e. there are either 52 or 104 cards in play.

  The playing field

The hand
    To begin with, all the cards to be used in the game are shuffled `in the player's hand' (at the bottom-right corner of the screen).

The piles
    From the well-shuffled hand one or more cards are added to the piles. The piles are in a row from left to right at the top of the playing field. Depending on the set of rules used, there can be different numbers of piles: Canfield, for example, only has four, while Spider has the maximum number of ten. The top card on each pile is turned up, i.e., its value and suit are visible. Any cards underneath are normaly hidden, i.e., only the back of the card is visible. Only in Seahaven all cards on all piles are visible right from the start. The number of hidden cards in a pile again depends on the set of rules. Little Harp, for example, earns its name from the fact that from left to right there is an decreasing number of hidden cards in the piles.

The reserve pile
    There is a reserve pile in some of the games. This is a pile of cards beside the hand with only the top card visible. At the deal, after the piles have been set up, a fixed number of cards is transferred from the hand to the reserve pile - in Little Harp, for example, three cards. If there is no reserve pile, one card per pile is dealt from the hand.

The penalty pile
    There can also be a so-called penalty pile - or lazy pile - in a solitaire game. It is shown in the bottom-left corner and consists of a fixed number of cards which are taken from the hand before the piles will be set up. As with the reserve pile, only the top card's value is visible.

The stacks
    The stacks can be seen at the right-hand side of the screen. The object of the game is to place all the cards on the stacks. The bases of the empty stacks show that each stack is reserved for one suit only, e.g. the topmost for Diamonds. Depending on the number of cards in the game there are four or eight stacks, i.e. one for each suit in each full deck of cards.

The work piles
    Sometimes there can be so called work piles on the left side of the stacks, on which any card can be laid; but just one card per pile.

The playing field in a battle solitaire
    Not all of what was said in the sections above is true for a battle solitaire. The player and the partner (regardless if computer or some other player) get their own hand, the one of the partner at the bottom of the right side, the player's one on the left. On each hand the cards are shuffeled seperate, so that at the beginning of a game each card is once in each hand. The reserve pile and the penalty pile are double each, too. Likewise the piles of the partner are to the right, the piles of the player to the left. During a game there is always one participant's turn, i.e. only the player or the partner may move cards. In the middle of the bottom of the playing field there is a big button, which displays the name of the participant whose turn it is. There is a red arrow tip attached to the button pointing to the private piles of the active player. The labeled button works like a chess clock; if the player can't move cards any more, she presses the button to signal the computer's or partner's turn. The sign on the button will change (the name of the partner or the word Computer will be shown) and the partner plays as long as possible, before the name of the player will appear again.

Who starts?
    At the start of a battle solitaire it will be determined, who's turn it is, i.e. who's name is displayed in the button (and hence has the right to move cards). This happens by card picking; from both shuffeled hands a card will be pulled. The comparison of the cards determines the beginner; its the player with the higher value. For same values the rule goes: Clubs about Spades about Hearts about Diamonds.

  Moving cards
Using the mouse, the player can move the pointer to a card of her choice. If she presses the left mouse button the card follows the cursor for as long as the button is depressed. Visually speaking, the player has now picked up the card, carried it around the playing field and then dropped it. If there is a card on a pile with its back facing up, it can be turned over by clicking on it with the left mouse button.

Moving single cards
    If the new position of the card is not a stack or pile (inclusive the reserve pile, penalty pile or work piles), the card is automatically returned to its starting position. If the new position is one of the above but is not in accordance with the rules described in the following, the card is likewise returned to its starting position. In a battle solitaire no card may be picked up from the piles of the partner (hand, reserve pile and penalty pile) in the bottom-right corner of the screen. If all appears to be correct, the card is brought to rest neatly in its new position. The computer keeps an internal account of all correct moves, which means it knows how many moves were required to solve the game and can report this in the congratulatory message desires - the necessary commands are provided in section Undo.

Moving several cards
    If several cards are turned up on one pile and are in sequence, they can be moved in one go. To do this, click with the mouse on the bottom card of the sequence to be moved and carry it to its new position. If the bottom card matches the top card on the target pile, the entire sequence is moved to this new pile. Sequences can only be moved to normal piles, and not to the reserve pile, the stacks, the work piles or the penalty pile. Note: For the stacks this is not true in Spider, as you will read in the next section. The last few paragraphs have referred only to sequences in piles; however, an entire pile can also be moved if the sequence runs from the top to the bottom card.

When can a card be moved to a stack?
    The next highest card of the same suit can be moved to a stack on which there is already at least one card; e.g., the Ten of Spades follows the Jack of Spades. On an empty stack only a card with the lowest value can be moved - most of the time an ace. In Canfield the lowest card is determined by moving the top most card of the hand to the stack automatically; it's value is the lowest value in this game. Since now the King may not be the highest value any more, the Ace fits on a King (likewise cyclic). In Spider there's a rule, that a family can only be brought complete to the stack. For this, the family first must be brought together on a pile before they can moved to the stack with one move. Here the game is solved already, when all families are completed on the piles; there is no need to move them to the stacks the stacks, in spider this is the highest goal to reach.

When can a card be moved to a pile?
    For the piles the general rule is as follow: Only the next smaller value fits on a card already there, and it exists the restriction: ``Red on black, black on red,'' which is called alternating from now on. For example on a Nine of Clubs can be layed the Eight of Diamonds or the Eight of Hearts. On an empty pile every card fits. No rule without it's exception: In Little Harp only the highest card (a King) can be moved to an empty pile. In Spider every card fits on another card with the next higher value; a moveable sequence however exists only of cards from the same suit. If e.g. a pile consists of a Nine of Clubs and Eight, Seven and Six of Hearts, only the top most three cards can be moved in one go. A Five of Clubs fits on this pile, however, the cards can't be moved together anymore. In Seahaven a card fits only on a pile, if the pile is empty or the card is the next lower value of the same suit as the top most card of the pile.

  The games
There are six different kind of solitaire games shipped: the so called standard solitaire, Canfield, the Little Harp, Spider, Seahaven and a Battle solitaire. A description of the differences of the rules follows.

Standard solitaire
    There are two decks of cards, i.e. 104 cards. It exists neither a reserve nor a penalty or work pile, but eight piles, containing three cards each at the start of a new game. On an empty stack there fits an Ace, on an empty pile every card. On an engaged pile a card fits, if it is the next lower value with alternating suit; together they form a moveable sequence.

Little Harp
    There is one deck of cards, i.e. 52 cards. It exists no penalty or work pile, but a reserve pile, which will be filled with three card each deal, and seven piles containing between seven and one cards at the start of a new game. On an empty stack there fits an Ace, on an empty pile only a King. On an engaged pile a card fits, if it is the next lower value with alternating suit; together they form a moveable sequence.

Canfield
    There is one deck of cards, i.e. 52 cards. It exists a penalty pile with thirteen cards, a reserve pile, which will be filled with three card each deal, four piles containing one card each at the start of a new game, but no work piles. On an empty stack there fits only a card with the lowest value (the first on the hand), on an empty pile every card. On an engaged pile a card fits, if it is the next lower value with alternating suit; together they form a moveable sequence.

Spider
    There are two decks of cards, i.e. 104 cards. It exists neither a reserve nor a penalty or work pile, but ten piles, containing five of six cards each at the start of a new game. Only complete families can be moved to the stack, on an empty pile fits every card. On an engaged pile a card fits, if it is the next lower value. They form a moveable sequence, if they got the same suit.

Seahaven
    There is one deck of cards, i.e. 52 cards. It exists neither a reserve nor a penalty pile, but four work piles. At the start of a game every of the ten piles has five cards, all with their faces up; two of the work piles got the remaining two cards, also with visible values. On an empty stack there fits an Ace, on an empty pile or work pile every card. On an engaged pile a card fits, if it is the next lower value of the same suit. There are no moveable sequences at all.

Battle solitaire
    There are two decks of cards, i.e. 104 cards. It exists per participant a penalty pile with thirteen cards and a reserve pile, which will be filled with one card each deal. There are eight piles containing one card each at the start of a new game, but no work piles. On an empty stack there fits an Ace, on an empty pile every card. On an engaged pile a card fits, if it is the next lower value with alternating suit. There are no moveable sequences at all.

Commands
In the following there is a description of the commands, that can be called by means of the menu, grouped in the same way as they are placed in the menu. After that there is a description of the commands, that can be called by keyboard shortcuts (section Keyboard commands) or mouse buttons (section Mouse buttons). Note: All menu entries ending with three dots (an ellipsis) pop up a dialog window, where the player can interact in a dialog, that is characterized in the following for the respective command.

  X
Behind the x logo is hiding the Produced by... dialog, which opens a window that is showing the title of this paper. After studying this window, a click on the Okay button with the mouse or a press of the return key leads back to the normal game.

  Games

The different kind of games
    In the top most section of this menu there is one button for every known set of rules not standing for a battle solitaire, normally Standard, Little Harp, Canfield, Seahaven and Spider. By means of these buttons it is determined according to which rules the cards can be laid. A new game can be started by clicking on a kind of rule. If in the current game at least one move was made, the player will be asked, if the old game should really be cancelled. The buttons with the sets of rules acts like radio buttons, i.e. activating one button with the mouse (diamond at the left side will become red), deactivates any other button.

Battle solitaires
    The next section of the menu are about battle solitaires. First the entry Fight with ... displays the name of the partner or the word Computer depending on the nature of the opponent. Them comes a list of all known rules for battle solitaires, marked to the left with a diamond. Normally this is only one entry, namely Battle solitaire. With this entry you can change the rules or start a new game, just like described in the section The different kind of games above. The entries below Establish contact..., Check contact..., Synchronize contact... and Ready to compete are for establish and keep the contact with another player. They are described in section Battle solitaires.

Demo
    The command Demo starts a demonstration, where the program tries to solve the game on its own. Before it moves a card or pile, an arrow indicates the next move. The time, which elapse before the arrow disappears, can be adjusted by the command Wait n sec.... After selecting this command a window opens and by moving the slider the time delay will be adjusted in tenth of a second.

Refresh screen
    The command Refresh screen rebuilds the playing ground. This can be very handy, if by unpleasant circumstances (program errors) the playing ground is not a mirror of the internal state of the game.

Quit
    This command puts an end to the whole game, not without asking the player, if she really wants to terminate the program.

  File

State of game
    The command Store... puts the current state of game in a file, by means of which the command Load... can restore it. Both commands open a window , with which the player can choose the external name of the file. Beneath the title, clarifying the need of the file, there are three entries Directory, File and Mask. As Directory the name of the current directory is displayed, the content of which is shown in the big area in the middle of the window. This area will be called select box from now on. The entry File contains the last by simple mouse click in the select box selected file name. It is initialized by the program; when the dialog is called multiple times, the last selected file name will be used. The complete path name of a file is the file name appended to the shown directory. With the entry Mask it can be restricted which files will be displayed in the select box, i.e. those whose file names match the contents of this entry. The two characters with special meaning are the question mark ?, which stands for exactly one arbitrary character, and the asterisk *, which stands for arbitrary many arbitrary characters. So the mask *.pat matches all file names with .pat at the end. In the select box first all directories and then all ordinary files are displayed in alphabetical order. The given mask applies only to the last kind. Directories will always be shown, whether their names match the mask or not. In the figure there are a lot of directories and there after one file is displayed, which name matches the mask, namely the file schwierig.pat. If there are more directories and matching files than fits in the select box, the player can scroll with the scrollbar at the right side of the select box. A click on the name of a ordinary file puts its name into the entry File; a click on the name of a directory modifies the entry Directory, and in the select box all files belonging to this directory are displayed. The first entries in the select box are always the dot . for the current directory and the double dot .. for the superior directory. A click on the current directory is useful, if the mask is modified, to reread the contents of the select box according to the new mask. If a file doesn't appear in the select box, since it should be created by the calling command, the name can be written directly in the entry File. This is meanigful only for commands like Store..., and there is no sence in it for a command like Load..., which is shown in figure datei. By pushing the button Okay in the bottom-right corner the current path name will be confirmed and the dialog quits positively. By pressing the button Cancel the dialog will be aborted. A double click on a name in the select box is like a single click on the name followed by a push down of the Okay button.

Edit rules
    The command opens a window, in which the rule editor displays the rules of the current game. The player can modify, apllying und store them. The usage of the rule editor is described in section The Rule editor.

Language
    At the bottom of the menu File there is the choice of all known languages (at least, known to the program) - currently german and english. After clicking on one language button the menu will be refreshed and from now on all dialog boxes will talk in that language. A currently opened help window or dialog for setting time or establish contact will switch to the new language if it will be reopened.

  Specials
This menu is a collection of commands, which should make the living of the player easier and which should support the solvation of the games.

Hints
    The command Hints displays a possible move by means of an arrow When determining the suggestion, the program works on all possible moves one by one, estimate them and finally shows the move that is classified as the most useful at this moment. By calling the command Hints again the next less valueable move will be displayed. If there is no more possible move, the bell of the computer will ring. Each call of this command will be registered and counted, so that the player will be noticed the number of given hints, when she finally solved the game.

Move to stacks
    For each pile and (if existing) the reserve, penalty and work piles the command Move to stacks checks, if the top most card can be moved to the according stack. When so, the move will be done by the program. This will continue, until no more card can be moved to the stacks. This command comes in very handy, when it's already clear, that the game is solved, and only the tiresome work of moving the cards to their stacks is left.

Undo
    There are different commands, that can make already done moves undone. They all works the same and are different only in the number of moves, they did undone. The command Undo one move undoes - the name is program - the recently done move. The intern counters of moves is decremented also; so the player can test a strategy unconcerned and remount on an old state of the game. The command Start over undoes all moves, till it reached the beginning of the game. This is done move by move, and the command quits, if the player hits any key. On this way she can undo comfortably to a situation back in the past. The command Mark marks the current state of the game. If there is at least one move since the marking, the command Back to mark skips back to this state. Once again the command stops, if the player hits any key.

Cheating
    The command Cheating disables the supervision of the rules. If the entry is activ (the square in the menu is red), a single card can be laid on every pile, without enforcing of the rules by the program. Every irregular action will be registered and counted, so that the player will be confronted with her cheating, if she solves the game.

  Cards
The command New cards can be called be clicking with the left (or right) mouse button on the hand, too. If there exists no reserve pile, the command takes one card per pile from the hand and puts it on the pile with the face turned up. If a reserve pile exists, the provided number of cards (usually 3) are moved from the hand to the reserve pile in a way, that only the face of the top most card can be seen. The menu entry below displays how much cards are still on the hand.

Cardfonts
    The cards are displayed as bitmaps, i.e. one coloured graphic. There are different sets of bitmaps available. Beside the standard font Normal there exists a set b/w with a more pale figure of the Clubs and Hearts. An enlargement of the standard font is Large. There are also some free available card fonts, which are named after their creators: Traub, Sager und Goyette. If the patience is interpreted by a wish of version 4, multi color cards in Gif or PPM format can be displayed, too. There is one cards font available in Gif format called Color.

With Comics
    Here are some switches, that can be adjusted dependend on the patience of the player: item{Movements:) Should the computer paint the fast moving cards? item{Shuffle:) Should the computer show the shuffle of the hand graphically? item{Shadow height:) In what distance above the playing ground will the computer dipslay the cards while moving? A distance of zero means, that no shadow will be displayed at all

  Help
By means of the command Rules of the game... this paper can be looked at in an extra window on the screen. Pressing the Okay button at the lower side of the window will close the window, although closing the window is not required for going on with the game. Note: If the program tkman(by Tom Phelps) for reading of man pages happens to run on the current display, it will be used to show the help text.

  Keyboard commands
The more important commands can be called directly from the keyboard. Table Keyboard commands lists all the keys and the (already described) commands, they are initiating.
Key	Command
n	Games/Start of a new game
d	Games/Demo
Ctrl-L	Games/Refresh screen
q	Games/Quit
l	File/Load
s	File/Store
h	Specials/Hints
m	Specials/Move to stacks
u	Specials/Undo one move
c	Cards/New cards
Keyboard commands

  Mouse buttons
In addition to the commands, which can be called by the menu, there is the possibility to move the pointer with the mouse to some locations on the playing ground and click there with the left or right button on some cards. By pressing the left mouse button above a card with it's face up this card is took up (see section Moving cards). By pressing the left mouse button above a card on a pile with it's face down this card will be turned over (see also section Moving cards). By pressing the left or right mouse button above the hand there will be dealed new cards to the pile or to the reserve pile (see section The playing field). By pressing the right mouse button above the reserve pile, the penalty pile or in the area of a pile the computer is requested to do something with this pile. The repertoire of reactions covers the movement of the top most card to the stacks and the movement of the top most sequence to another pile. If by this way a card with it's back up will become the card on the top of the pile, it will turned over. So to say, the right mouse button is the way to push the computer to do the work, that the player can do with the left mouse button by herself in a multiple of time...

Battle solitaires
For some games the rules determine, that two players can play against each other (or that one player can play against the computer). This games are called battle solitaires. Normally exactly one game of this kind is available, whichs name is just Battle solitaire.

Challenge a partner
    The menu entry Establish contact... is activated, when there currently a battle solitaire against the computer is going on. When clicking on it, a window is popping up for looking for another partner. A contact to a player on a remote host is only possible, if the patience is interpreted by dpwish. A contact to a player on the same display is possible in every case (but only interesting for test purpose). In section Installation is a description, how the interpreter can be changed. The menu entry Establish contact... is deactivated, and therefore in a grey font and not applicable, if currently a game against a human partner is going on. Instead the both entries underneath are activ. By means of Check contact... you can test during a game, whether the connection to the partner on a remote host is still alive. This command is a little bit like the net command ping. Is the connection still up, nothing happens; otherwise a window pops up to state the problem. The command Synchronize contact... is convinient, if the connection was interupted temporary; then it can happen, that the state of the game differs on both hosts. By means of this command the partner will be asked, if she accept the state of the other player. If she clicks on Accept, in both games the state will be set to the state of the asking player. Below is the switch Ready to compete; it determines, if it is okay to get disturbed by the challenges of other players (diamond is red) or if nobody should interrupt the game (diamond is grey). If you turn on the switch and the programm isn't interpreted by dpwish, a dialog will pop up to say, that player on remote hosts aren't reachable.

Quit a battle solitaire
    While its the player's turn, a game against the computer can be finished like a normal game by e.g. choosing another rule set in menu Games, by Games/Quit or even by pressing the keys q or n. While its the computer's turn, only a surrender by pressing the keys q or n is possible since the menus are deactivated. When during a game against another human player a command that would terminate the current play is called, a dialog pops up. There you can choose, whether the connection to the partner should be terminated completely or whether the current play is just finished for a new game. After pushing the button Quit, the partner gets a message, that the other side had surrendered. By pushing of New game the partner gets an option, if she is willing to finish the current game for a new one.

The Rule editor
The rule editor is called with the command Edit rules in the menu File. It opens a window of its own displaying the rules of the current game. Section The entries of the rule editor describes the entries of the rule editor and section The commands of the rule editor all the buttons in the lower two rows.

  The entries of the rule editor

Name (intern)
    The name of the rule set, that is only used internally in the program, is only shown here. It is changed by means of the command New (section New) or Load (section ef{sssec:Load)). Normally this name should correspond to the prefix of the file name, in which the rules are stored (section Store).

Name (extern)
    The extern name of the rule set is the name, that is visible for the player. E.g., it appears in the menu Games, or in the titlebar of the whole windows The extern name of the rule set in the current language will be displayed. There are good chances, that the name is different in any language, so an entry form pops up, if the extern name is selected with the mouse button. In this form there is an entry for every known language bottom.

Number of decks
    This field adjusts, whether the game plays with one or two decks of cards. One deck of cards consists of 52 cards (13 values in 4 suits).

Battle game
    This field adjusts, whether it is a battle patience. If so, you can determine, too, whether two card decks (if existing) are dealt separate.

Reserve pile
    By means of the slider it can be adjusted, whether there exists a reserve pile in this set of rules (slider on a position greater 0) or not (slider at the left). The position of the slider determines, how many cards will be moved, when dealing from hand to reserve pile.

Penalty pile
    The slider adjusts, whether there exists a penalty pile in this set of rules (slider on a position greater 0) or not (slider at the left). The position of the slider determines, how many cards will be moved to the penalty pile at the start of the game.

Work piles
    The slider adjusts, whether there exists work piles in this set of rules (slider on a position greater 0) or not (slider at the left). There can be upto 4 work piles.

Underlying cards visible
    This menu item adjusts, whether at the start of a game all cards on the piles are with its face up (yes), or just the top most card of every pile is visible and the values of all underlying cards are hidden (no).

No. of piles
    The number of piles, which exists in the set of rules, are adjusted with the horizontally slider (between 1 and 10). For each pile there is a vertically slider underneath, which determines how many cards are laying upside down (between 0 and 10) on a pile at the start of the game. There is always one card with its face up on the pile. I.e. 0 doesn't mean that there is no card on this pile but that under the card with it's face up there is no further card.

Allowed on piles
    This menu item adjusts the rule, whether a card fits on another pile. There are the combinations of Increasing, Decreasing or In-/Decreasing with same, black/red or any to choose. Increasing, Decreasing and In-/Decreasing refers to the values of the involved cards. If the rule says increasing, the value of the upper card must be the next higher one, if it says decreasing, the value must be the next lower one. For an increasing rule e.g. a Jack fits on a 10. Same, black/red and any refers to the suit of the cards. Same means that both cards must be of the same suit. black/red means that on a card of Hearts or Diamonds fits a card of Spades or Clubs, and vice versa. black/red is sometimes called alternating. Any says, that the suit of the cards doesn't matter for the cards to fit on each other.

Moveable sequences
    This menu item adjusts the rule, whether cards that lay upon each other build a moveable sequence. There are the same combinations as for Allowed on pile (see section Allowed on piles) plus the additional Just one card. Just one card means, that only one card can be picked up in one move and that there are no moveable sequences at all in this set of rules.

Allowed on stack
    This menu item adjusts the rule, whether a card fits on a stack. There are the combinations of Increasing or Decreasing with same or complete to choose. The combinations with black/red or any are missing, since stacks are always tide to a suit. Complete means, that no single card can be moved to a stack, but that the whole family must be collected on a pile, before they can be brought to the stack with one move.

Allowed on penalty pile
    This menu item adjusts the rule, whether a card fits on a penalty pile. There are the combinations of Increasing, Decreasing or In-/Decreasing with same or black/red to choose. This adjustment is only for battle solitaires, where two players will play against each other, since no player will lay a card on her own penalty pile.

Ground of stack
    This menu item determines the card's base value for the stack. There can be choosen every single value (perhaps most of the time the Ace). The special option First card moves automatically after dealing at start of the game the top most card of the hand to the stack; its value determines the ground of all other stacks. Since now the King isn't the highest value anymore, the Ace fits on a King (likewise cyclic).

Ground of pile
    This menu item determines the base value of an empty pile. There are the options any card and only the highest to choose. The value of the highest card depends on the ground of stack and the rule, what is allowed on a pile. If e.g. (as in the Little Harp) an Ace is the ground of stack and on the piles cards fit decreasing alternating onto each other, the current ground of pile is the King. If e.g. the ground of pile is only the highest and Jack is the first card on a stack, then the base for increasing piles is a Queen.

Old cards are moveable
    This field adjusts, whether old cards can be moved from the reserve pile. A card on the reserve pile is old, if it was hidden by another card in the meantime or if it's the player's turn again in a battle solitaire. At the same time this entry determines, whether cards can be picked up from the stack.

  The commands of the rule editor

New This command renames the rule set by setting the entry Name (intern) a new value. A windowpops up listed in the window.

Load
    This command pops up the dialog for loading a file as described in State of game. Here an already stored set of rules can be loaded. The file names of files with a set of rules normally end with .spr (german Spielregel), so the entry Mask is initialized with *.spr. The rules for the predefined games are stored in the directory spiel of the library directory, e.g. in /usr/lib/X11/patience-1.8/spiel.

Store
    This command pops up the dialog for storing a file as described in State of game. Here the current set of rule can be stored. The file names of files with a set of rules normally end with .spr (german Spielregel), so the entry Mask is initialized with *.spr. If the write permission into the library directory is missing, the rule sets can be collected in a private directory and the resource sprPath (see also section Installation) can point to that directory. The resource can also be a list of directories separated by :; the program will look at start in the given directories for rule sets. An example for the resource goes:
    Patience*sprPath: /home/krischan/spiel:/usr/lib/X11/patience-1.8/spiel

Cancel
    The window of the rule editor will be closed without confirmation, and the game continues with the rules selected before the editor was called.

Apply
    The changing of the adjustments in the rule editor doesn't have an immidiate effect on the currently played game (Imagine, there is the number of piles changing in the middle of the game!). Apply starts a new game according to the edited rules.

Okay
    A push of Okay is like clicking on Store, Apply and Cancel. If during the store or apply a Cancel button is pressed, the work is canceled, and the rule editor remains open.

Installation

  Installation of the executable Tcl program
The choice, where the executable program and the associated library directory are located, is a matter of taste. For me there are a few candidates, which are listed in table Possible Path names for binDir and libDir.
Executable program	Library directory
/usr/games/solitaire	/usr/games/lib/patience-1.8
/usr/bin/X11/solitaire	/usr/lib/X11/patience-1.8
/usr/local/bin/solitaire	/usr/local/lib/patience-1.8
/home/krischan/bin/solitaire	/home/krischan/patience-1.8
Possible Path names for binDir and libDir Who ever installs the solitaire, must have write access to both of the choosen directories. Then the solitaire can be installed by the following few steps, replacing binDir and libDir with the choosen directories. Making the directory superior to the choosen library directory the current one, e.g. by
cd /usr/local/lib
Download the installations disk by tar xvzf /dev/fd0. That is at least the way, it works out at my system. Maybe you must give another name like /dev/floppy or /dev/rfd0H1440ds. If the installation file is already on disk or on a mounted cd, you can unpack it with e.g tar xvzf /tmp/patience-1.8.tar.gz. Who owns a tar without the handy z option for uncompress, must use something like the following:
gzip -cd /cdrom/longPathName/patience-1.8.tar.gz | tar xvf -
Change into the newly created directory: cd patience-1.8 If you have already a wish of version 4, you can start right now the installation tool install.tcl. It is an english spoken Tk program, which offers all the following items as menu entries. Start with browsing through the Configure and Configure/app-default menus. There you can e.g. switch to english as default language of the game by Configure/app-default/sprache. You can create the patience executable by Make Patience. A test game can be played by Make/(Make then) Start. An installation of the whole thing is launched by Make Installation. If there is no new wish available or no X display is near or other reasons are against a graphical interface, you can continue with the installation by following the next items. Using the editor of choise change the Makefile; around line 15 set the following variables according to the local machine and/or to the personal taste. WISH: This variable contains the complete path of the Tcl/Tk interpreter. You can find it out (in Bourne-, Korn- or compliant shells) by means of calling type wish. At my system the line goes like WISH = /usr/bin/X11/wish. For using the functions described in section Battle solitaires with remote hosts, you must give the name of an interpreter shell, which includes the procedures of Tcl-DP. Normally the name of this shell is dpwish. The tar archiv with the distribution of Tcl-DP is called tcl-dp3.2.tar.Z and you can get it by ftp at mm-ftp.cs.berkeley.edu in the directory /pub/multimedia/Tcl-DP. LIB_DIR: This is the choosen libDir; at my system currently the line goes like LIB_DIR = /home/krischan/patience-1.8. BIN_DIR: This is the choosen binDir, at my system currently the line goes like BIN_DIR = /home/krischan/patience-1.8. CFLAGS: For compiling the extended patience interpreter patsh there may be additional include directories, which contain the Tcl includefiles. Now call make patience; after five to ten seconds everything should be ready to take off. Default language is german, but you can switch to english in app-default, the resource file containing the defaults. For this, edit the file in the current directory and uncomment the line by removing the leading exclamation mark, so that it read as the following: *patience.sprache: english A test game can be started right now by calling ./patience. For playing it from every directory without typing the complete path, enter make install.

  The extended interpreter
Who likes, can compile a c program patsh.c; this happens by means of the Makefile and a call of make patc. After that you install the created program by calling make installc. Making patc creates a patience interpreter patsh, too; it acts like the ordinary Tk interpreter wish, but is extended by a procedure for merging the cards and some central functions for checking the rules, which are implemented in C and therefore a little bit faster.

  Calling with different names
If the program has the intern name of a known set of rules (e.g. canfield), the game will start according to this rules. Who likes, can play immediate a Little Harp solitaire after execution of the following commands. ln -s patience canfield This works also with the intern names of other, possible self made sets of rules. The name of the wanted set of rules can be given as parameter, too. The battle solitaire e.g. can be started directly by calling patience -name streit This way it is possible to create a submenu for the window manager, which starts the game with any set of rules. In the initialization file .fvwmrc of the {fvwm) window mananger it goes like:
Popup "Patience 1.8"
Exec "Standard"    exec patience
Exec "Little Harp" exec patience -name klHarfe
Exec "Canfield"    exec patience -name canfield
Exec "Spider"      exec patience -name spider
Exec "Battle Sol." exec patience -name streit
Exec "Seahaven"    exec patience -name seahaven
EndPopup

  X-Resourcen
The program uses a few X resource variables, which can configure the user interface. table X resources is a listing of names, their default values and their significance.
Resource	Default	Meaning
warteZeit	10	Default of Games/Wait n sec
rot	IndianRed4	Foreground color of Diamonds and Hearts
grau	gray80	Gray background color of stacks
weiss	gray95	White background color of cards
xlogo	/usr/include/X11/bitmaps/xlogo11
		Bitmap at the left in menubar
sprPath	libDir/spiel	Directories to look for rule files
mitMischComic	True	Default of With comics/Shuffle
mitBewegComic	True	Default of With comics/Movements
schatten	5	Default of With comics/Shadow height
mitStreitbar	False	Default of Games/Ready to compete
kartenFont	normal	Default of the card bitmaps
sprache	deutsch	the language (deutsch or english)
daemonPort	4567	Port number of the patience daemon
X resources The resources concerning colors (rot, weiss and grau) only have effects on cards displayed as bitmaps; for cards displayed as gif or pixmaps they have no effect. The resources will be looked up at the following places with increasing priority: the defaults given by the program itself, as in table X resources; the systemwide installed resource file libDir/app-default; the resource file /.Xdefaults configured by the player; all resources set by xrdb -merge In a resourced file every assignment of a value to the resource goes like this: *patience.resourcename: value E.g., the Black/White-Font as default for the card bitmaps can be set by *patience.kartenFont: sw

  Known errors
The tip of the arrow has an incorrect y coordinate for compressed piles.

  Future Improvements
All invisible cards (on the stack, reserve or penalty pile) should be deleted from the playing field to speed up the comics for dealing or movement of cards.

AUTHOR
krischan@cs.tu-berlin