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

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 ex-
treme 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 independent-
ly 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 ttccll77..44 and ttkk44..00 (or ttccll77..33  and  ttkk33..66)  in
about 10 seconds.

There  is  a rule editor with which new sets of rules can be com-
piled (and stored); these new games can then be played  in  addi-
tion to the six games provided.

The program is localized; dependent on a resource there is a ger-
man or english user interface.

ttkkmmaann will be used as browser of the help text, if it is  running
on the current display.

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 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  re-
serve 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  re-
serve 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 re-
served for one suit only, e.g. the topmost for Diamonds.  Depend-
ing  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 bat-
tle 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  ar-
row  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 comput-
er's or partner's turn. The sign on the button will  change  (the
name  of  the partner or the word CCoommppuutteerr 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 deter-
mined, who's turn it is, i.e. who's name is displayed in the but-
ton (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.

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  posi-
tion.  If  the new position is one of the above but is not in ac-
cordance 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 re-
quired to solve the game and can report this in the congratulato-
ry  message desires - the necessary commands are provided in sec-
tion 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 match-
es 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 re-
serve 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 Can-
field 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 com-
plete 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 small-
er value fits on a card already there, and it exists the restric-
tion: ``Red on black, black on red,'' which is called _a_l_t_e_r_n_a_t_i_n_g
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.



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; to-
gether 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, con-
taining 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 move-
able sequences at all.

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 Key-
board 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  com-
mand.

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

The different kind of games

In the top most section of this menu there is one button for  ev-
ery  known set of rules not standing for a battle solitaire, nor-
mally SSttaannddaarrdd, LLiittttllee HHaarrpp, CCaannffiieelldd, SSeeaahhaavveenn  and  SSppiiddeerr.  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 FFiigghhtt wwiitthh ...... displays the name of
the partner or the word CCoommppuutteerr 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  en-
try,  namely BBaattttllee ssoolliittaaiirree. 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  EEssttaabblliisshh ccoonnttaacctt......, CChheecckk ccoonnttaacctt......, SSyynn--
cchhrroonniizzee ccoonnttaacctt...... and RReeaaddyy ttoo ccoommppeettee are  for  establish  and
keep  the contact with another player. They are described in sec-
tion Battle solitaires.


Demo The command DDeemmoo 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  ad-
justed by the command WWaaiitt _n sseecc....... 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 RReeffrreesshh ssccrreeeenn rebuilds the playing
ground. This can be very handy, if  by  unpleasant  circumstances
(program errors) the playing ground is not a mirror of the inter-
nal state of the game.

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


State of game The command SSttoorree...... puts the current state of game
in a file, by means of which the command LLooaadd...... 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 DDiirreeccttoorryy, FFiillee and MMaasskk.

As  DDiirreeccttoorryy 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 _s_e_l_e_c_t _b_o_x from now on.

The entry FFiillee contains the last by simple mouse click in the se-
lect 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 MMaasskk it can be restricted which files will be dis-
played 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 **..ppaatt matches  all  file  names
with ..ppaatt 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 sscchhwwiieerriigg..ppaatt.

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 en-
try  FFiillee;  a click on the name of a directory modifies the entry
DDiirreeccttoorryy, and in the select box all files belonging to this  di-
rectory are displayed.

The  first entries in the select box are always the dot .. for the
current directory and the double dot .... for the superior directo-
ry.  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  FFiillee.  This  is  meanigful only for commands like
SSttoorree......, and there is no sence in it for a command like LLooaadd......,
which is shown in figure datei.

By pushing the button OOkkaayy in the bottom-right corner the current
path name will be confirmed and the dialog quits positively.   By
pressing  the button CCaanncceell 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 OOkkaayy 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 de-
scribed in section The Rule editor.

Language At the bottom of the menu FFiillee 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.

This menu is a collection of commands, which should make the liv-
ing  of  the player easier and which should support the solvation
of the games.

Hints The command HHiinnttss displays a possible move by means  of  an
arrow

When  determining the suggestion, the program works on all possi-
ble 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 HHiinnttss again the next less valueable move will be dis-
played.  If  there is no more possible move, the bell of the com-
puter 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 MMoovvee ttoo ssttaacckkss 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 UUnnddoo oonnee mmoovvee undoes - the name is program - the  re-
cently done move. The intern counters of moves is decremented al-
so; so the player can test a strategy unconcerned and remount  on
an old state of the game.

The  command SSttaarrtt oovveerr undoes all moves, till it reached the be-
ginning 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 com-
fortably to a situation back in the past.

The command MMaarrkk marks the current state of the game. If there is
at  least  one  move  since the marking, the command BBaacckk ttoo mmaarrkk
skips back to this state. Once again the command  stops,  if  the
player hits any key.

Cheating  The  command  CChheeaattiinngg  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.

The command NNeeww ccaarrddss 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 (usu-
ally 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 NNoorrmmaall there exists a set bb//ww with a more  pale
figure  of  the  Clubs and Hearts. An enlargement of the standard
font is LLaarrggee.

There are also some free available card fonts,  which  are  named
after their creators: TTrraauubb, SSaaggeerr und GGooyyeettttee.

If the patience is interpreted by a wwiisshh of version 4, multi col-
or cards in Gif or PPM format can be displayed, too. There is one
cards font available in Gif format called CCoolloorr.

With  Comics  Here are some switches, that can be adjusted depen-
dend on the patience of the player: item{MMoovveemmeennttss:)  Should  the
computer  paint the fast moving cards?  item{SShhuuffffllee:) Should the
computer show the shuffle of the hand  graphically?   item{SShhaaddooww
hheeiigghhtt:)  In what distance above the playing ground will the com-
puter dipslay the cards while moving? A distance of  zero  means,
that no shadow will be displayed at all

By  means  of  the command RRuulleess ooff tthhee ggaammee...... this paper can be
looked at in an extra window on the  screen.  Pressing  the  OOkkaayy
button at the lower side of the window will close the window, al-
though closing the window is not required for going on  with  the
game.

Note:  If  the  program  ttkkmmaann(by  Tom Phelps) for reading of man
pages happens to run on the current display, it will be  used  to
show the help text.

The  more important commands can be called directly from the key-
board.  Table Keyboard commands lists all the keys and  the  (al-
ready described) commands, they are initiating.

KKeeyy     CCoommmmaanndd
nn       GGaammeess/Start of a new game
dd       GGaammeess/DDeemmoo
CCttrrll--LL  GGaammeess/RReeffrreesshh ssccrreeeenn
qq       GGaammeess/QQuuiitt
ll       FFiillee/LLooaadd
ss       FFiillee/SSttoorree
hh       SSppeecciiaallss/HHiinnttss
mm       SSppeecciiaallss/MMoovvee ttoo ssttaacckkss
uu       SSppeecciiaallss/UUnnddoo oonnee mmoovvee
cc       CCaarrddss/NNeeww ccaarrddss
KKeeyybbooaarrdd ccoommmmaannddss


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...

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

Challenge a partner

The menu entry EEssttaabblliisshh ccoonnttaacctt...... is activated, when there cur-
rently 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 ddppwwiisshh. 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 EEssttaabblliisshh ccoonnttaacctt...... 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 CChheecckk ccoonnttaacctt...... 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 ppiinngg.   Is  the
connection  still up, nothing happens; otherwise a window pops up
to state the problem.

The command SSyynncchhrroonniizzee ccoonnttaacctt...... is convinient, if the  connec-
tion 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 play-
er.  If she clicks on AAcccceepptt, in both games the state will be set
to the state of the asking player.

Below  is  the  switch  RReeaaddyy ttoo ccoommppeettee; 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
ddppwwiisshh,  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 GGaammeess, by GGaammeess/QQuuiitt or even by pressing the keys  qq  or  nn.
While  its  the computer's turn, only a surrender by pressing the
keys qq or nn 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 QQuuiitt, the partner gets a  message,  that
the  other side had surrendered. By pushing of NNeeww ggaammee the part-
ner gets an option, if she is willing to finish the current  game
for a new one.

The rule editor is called with the command EEddiitt rruulleess in the menu
FFiillee. 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.


Name  (intern) The name of the rule set, that is only used inter-
nally in the program, is only shown here. It is changed by  means
oeff{sstsheec:Locaodm)m)a.ndNorNNmeeawwlly (tsheicstinoanme  Nsehwo)uld orcorrLLeoosaapddond (steoctitohne

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 GGaammeess, 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 se-
lected  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 exist-
ing) 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 po-
sition 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 (yyeess), or just the top most
card of every pile is visible and the values  of  all  underlying
cards are hidden (nnoo).

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 IInnccrreeaassiinngg,
DDeeccrreeaassiinngg or IInn--//DDeeccrreeaassiinngg  with  ssaammee,  bbllaacckk//rreedd  or  aannyy  to
choose.

IInnccrreeaassiinngg, DDeeccrreeaassiinngg and IInn--//DDeeccrreeaassiinngg 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.

SSaammee,  bbllaacckk//rreedd  and  aannyy  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 AAlllloowweedd oonn ppiillee (see section Allowed  on
piles) plus the additional JJuusstt oonnee ccaarrdd.

JJuusstt  oonnee  ccaarrdd 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 IInnccrreeaassiinngg or  DDee--
ccrreeaassiinngg  with  ssaammee or ccoommpplleettee to choose. The combinations with
bbllaacckk//rreedd or aannyy are missing, since stacks are always tide  to  a
suit.

CCoommpplleettee  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  IInn--
ccrreeaassiinngg,  DDeeccrreeaassiinngg or IInn--//DDeeccrreeaassiinngg with ssaammee or bbllaacckk//rreedd 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 FFiirrsstt ccaarrdd 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 aannyy ccaarrdd and oonnllyy tthhee hhiigghheesstt 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 oonnllyy tthhee  hhiigghheesstt
and Jack is the first card on a stack, then the base for increas-
ing piles is a Queen.

Old cards are moveable This field adjusts, whether _o_l_d 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 bat-
tle solitaire.

At  the  same  time  this  entry determines, whether cards can be
picked up from the stack.


New This command renames the rule set by setting the  entry  NNaammee
((iinntteerrnn)) a new value.


A windowpops up listed in the window.

Load  This  command  pops up the dialog for loading a file as de-
scribed 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 ..sspprr (german SSppielrregel), so the entry MMaasskk is  initial-
ized with **..sspprr.

The  rules  for  the predefined games are stored in the directory
ssppiieell     of     the     library     directory,      e.g.      in
//uussrr//lliibb//XX1111//ppaattiieennccee--11..88//ssppiieell.

Store  This  command pops up the dialog for storing a file as de-
scribed 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 ..sspprr (german SSppielrregel), so the entry MMaasskk  is  initialized
with **..sspprr.

If  the  write  permission into the library directory is missing,
the rule sets can be collected in a private directory and the re-
source  sspprrPPaatthh (see also section Installation) can point to that
directory. The resource can also be a list of  directories  sepa-
rated  by ::; the program will look at start in the given directo-
ries 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  con-
firmation,  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!).  AAppppllyy starts a new game according to the edited rules.

Okay  A push of OOkkaayy is like clicking on SSttoorree, AAppppllyy and CCaanncceell.
If during the store or apply a CCaanncceell button is pressed, the work
is canceled, and the rule editor remains open.


The  choice,  where the executable program and the associated li-
brary 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.

EExxeeccuuttaabbllee pprrooggrraamm          LLiibbrraarryy ddiirreeccttoorryy
//uussrr//ggaammeess//ssoolliittaaiirree        //uussrr//ggaammeess//lliibb//ppaattiieennccee--11..88
//uussrr//bbiinn//XX1111//ssoolliittaaiirree      //uussrr//lliibb//XX1111//ppaattiieennccee--11..88
//uussrr//llooccaall//bbiinn//ssoolliittaaiirree    //uussrr//llooccaall//lliibb//ppaattiieennccee--11..88
//hhoommee//kkrriisscchhaann//bbiinn//ssoolliittaaiirree//hhoommee//kkrriisscchhaann//ppaattiieennccee--11..88
PPoossssiibbllee PPaatthh nnaammeess ffoorr _b_i_n_D_i_r aanndd _l_i_b_D_i_r


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 _b_i_n_D_i_r and _l_i_b_D_i_r 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 ttaarr xxvvzzff //ddeevv//ffdd00.  That is at
least the way, it works out at my system. Maybe you must give an-
other name like //ddeevv//ffllooppppyy or //ddeevv//rrffdd00HH11444400ddss.  If the  instal-
lation file is already on disk or on a mounted cd, you can unpack
it with e.g ttaarr xxvvzzff //ttmmpp//ppaattiieennccee--11..88..ttaarr..ggzz.  Who  owns  a  ttaarr
without  the  handy  zz  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:  ccdd ppaattiieennccee--11..88

If you have already a wwiisshh of version 4, you can start right  now
the  installation  tool  iinnssttaallll..ttccll.  It is an english spoken Tk
program, which offers all the following items  as  menu  entries.
Start  with  browsing  through  the  CCoonnffiigguurree and CCoonnffiigguurree/aapppp--
ddeeffaauulltt menus. There you can e.g. switch to  english  as  default
language  of  the game by CCoonnffiigguurree/aapppp--ddeeffaauulltt/sspprraacchhee.  You can
create the patience executable by MMaakkee PPaattiieennccee.  A test game can
be  played  by  MMaakkee//((MMaakkee  tthheenn))  SSttaarrtt.  An installation of the
whole thing is launched by MMaakkee IInnssttaallllaattiioonn.

If there is no new wwiisshh available or no X display is near or oth-
er  reasons  are  against a graphical interface, you can continue
with the installation by following the next items.

Using the editor of choise change the MMaakkeeffiillee;  around  line  15
set the following variables according to the local machine and/or
to the personal taste.

WWIISSHH:: This variable contains the complete path of the Tcl/Tk  in-
terpreter.  You  can  find it out (in Bourne-, Korn- or compliant
shells) by means of calling ttyyppee wwiisshh. At my system the line goes
like WWIISSHH == //uussrr//bbiinn//XX1111//wwiisshh.

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 ddppwwiisshh. The tar archiv with the distribution  of
Tcl-DP is called ttccll--ddpp33..22..ttaarr..ZZ and you can get it by ftp at mmmm--
ffttpp..ccss..bbeerrkkeelleeyy..eedduu in the directory //ppuubb//mmuullttiimmeeddiiaa//TTccll--DDPP.

LLIIBB__DDIIRR:: This is the choosen _l_i_b_D_i_r; at my system  currently  the
line goes like LLIIBB__DDIIRR == //hhoommee//kkrriisscchhaann//ppaattiieennccee--11..88.

BBIINN__DDIIRR::  This  is the choosen _b_i_n_D_i_r, at my system currently the
line goes like BBIINN__DDIIRR == //hhoommee//kkrriisscchhaann//ppaattiieennccee--11..88.

CCFFLLAAGGSS:: For compiling the  extended  patience  interpreter  ppaattsshh
there  may  be  additional include directories, which contain the
Tcl includefiles.

Now call mmaakkee ppaattiieennccee; after  five  to  ten  seconds  everything
should be ready to take off.

Default language is german, but you can switch to english in aapppp--
ddeeffaauulltt, the resource file containing the defaults. For this, ed-
it  the  file  in the current directory and uncomment the line by
removing the leading exclamation mark, so that  it  read  as  the
following:

**ppaattiieennccee..sspprraacchhee:: eenngglliisshh

A  test game can be started right now by calling ..//ppaattiieennccee.  For
playing it from every directory without typing the complete path,
enter mmaakkee iinnssttaallll.

Who likes, can compile a c program ppaattsshh..cc; this happens by means
of the MMaakkeeffiillee and a call of mmaakkee ppaattcc. After that  you  install
the created program by calling mmaakkee iinnssttaallllcc.

Making  ppaattcc  creates  a patience interpreter ppaattsshh, too; it acts
like the ordinary Tk interpreter wwiisshh, but is extended by a  pro-
cedure  for  merging  the  cards  and  some central functions for
checking the rules, which are implemented in C  and  therefore  a
little bit faster.


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.

llnn --ss ppaattiieennccee ccaannffiieelldd

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

ppaattiieennccee --nnaammee ssttrreeiitt

This way it is possible to create a submenu for the window manag-
er, which starts the game with any set of rules.  In the initial-
ization file ..ffvvwwmmrrcc  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

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.

RReessoouurrccee        DDeeffaauulltt MMeeaanniinngg
wwaarrtteeZZeeiitt       1100      Default of GGaammeess/WWaaiitt _n sseecc
rroott             IInnddiiaannRReedd44Foreground color of Diamonds and Hearts
ggrraauu            ggrraayy8800  Gray background color of stacks
wweeiissss           ggrraayy9955  White background color of cards
xxllooggoo           //uussrr//iinncclluuddee//XX1111//bbiittmmaappss//xxllooggoo1111
                        Bitmap at the left in menubar
sspprrPPaatthh         _l_i_b_D_i_r//ssppiieellDirectories to look for rule files
mmiittMMiisscchhCCoommiicc   TTrruuee    Default of WWiitthh ccoommiiccss/SShhuuffffllee
mmiittBBeewweeggCCoommiicc   TTrruuee    Default of WWiitthh ccoommiiccss/MMoovveemmeennttss
sscchhaatttteenn        55       Default of WWiitthh ccoommiiccss/SShhaaddooww hheeiigghhtt
mmiittSSttrreeiittbbaarr    FFaallssee   Default of GGaammeess/RReeaaddyy ttoo ccoommppeettee
kkaarrtteennFFoonntt      nnoorrmmaall  Default of the card bitmaps
sspprraacchhee         ddeeuuttsscchh the language (ddeeuuttsscchh or eenngglliisshh)
ddaaeemmoonnPPoorrtt      44556677    Port number of the patience daemon
XX rreessoouurrcceess


The resources concerning colors (rroott, wweeiissss and ggrraauu)  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  in-
creasing priority:

the  defaults  given  by  the  program  itself, as in table X re-
sources;

the systemwide installed resource file _l_i_b_D_i_r//aapppp--ddeeffaauulltt;

the resource file  //..XXddeeffaauullttss configured by the player;

all resources set by xxrrddbb --mmeerrggee In a resourced  file  every  as-
signment of a value to the resource goes like this:

**ppaattiieennccee.._r_e_s_o_u_r_c_e_n_a_m_e:: _v_a_l_u_e

E.g., the Black/White-Font as default for the card bitmaps can be
set by

**ppaattiieennccee..kkaarrtteennFFoonntt:: ssww


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


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.


krischan@cs.tu-berlin





































