Merge from vendor branch LIBARCHIVE:
[games.git] / games / cribbage / cribbage.6
1 .\" Copyright (c) 1980, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)cribbage.6  8.1 (Berkeley) 5/31/93
33 .\" $FreeBSD: src/games/cribbage/cribbage.6,v 1.3 1999/08/27 23:28:59 peter Exp $
34 .\" $DragonFly: src/games/cribbage/cribbage.6,v 1.3 2007/03/11 19:05:31 swildner Exp $
35 .\"
36 .Dd May 31, 1993
37 .Dt CRIBBAGE 6
38 .Os
39 .Sh NAME
40 .Nm cribbage
41 .Nd the card game cribbage
42 .Sh SYNOPSIS
43 .Nm
44 .Op Fl eqr
45 .Sh DESCRIPTION
46 .Nm
47 plays the card game cribbage, with the program playing one hand
48 and the user the other.
49 The program will initially ask the user if the rules of the game are
50 needed \(en if so, it will print out the appropriate section from
51 .Em According to Hoyle
52 with
53 .Xr more 1 .
54 .Pp
55 .Nm
56 options include:
57 .Bl -tag -width ".Fl e"
58 .It Fl e
59 When the player makes a mistake scoring his hand or crib, provide an
60 explanation of the correct score.
61 (This is especially useful for beginning players.)
62 .It Fl q
63 Print a shorter form of all messages \(en this is only recommended for
64 users who have played the game without specifying this option.
65 .It Fl r
66 Instead of asking the player to cut the deck, the program will randomly
67 cut the deck.
68 .El
69 .Pp
70 .Nm
71 first asks the player whether he wishes to play a short game (
72 .Dq once around ,
73 to 61) or a long game (
74 .Dq twice around ,
75 to 121).
76 A response of
77 .Sq Ic s
78 will result in a short game, any other response will play a long game.
79 .Pp
80 At the start of the first game, the program
81 asks the player to cut the deck to determine who gets the first crib.
82 The user should respond with a number between 0 and
83 51, indicating how many cards down the deck is to be cut.
84 The player who cuts the lower ranked card gets the first crib.
85 If more than one game is played, the
86 loser of the previous game gets the first crib in the current game.
87 .Pp
88 For each hand, the program first prints the player's hand,
89 whose crib it is, and then asks the player
90 to discard two cards into the crib.
91 The cards are prompted for one per line, and are typed as explained below.
92 .Pp
93 After discarding, the program cuts the deck (if it is the player's
94 crib) or asks the player to cut the deck (if it's its crib); in the latter
95 case, the appropriate response is a number from 0 to 39 indicating
96 how far down the remaining 40 cards are to be cut.
97 .Pp
98 After cutting the deck, play starts with the non-dealer (the person
99 who doesn't have the crib) leading the first card.
100 Play continues, as per cribbage, until all cards are exhausted.
101 The program keeps track of the scoring of all points and the total of
102 the cards on the table.
103 .Pp
104 After play, the hands are scored.
105 The program requests the player to
106 score his hand (and the crib, if it is his) by printing out the
107 appropriate cards (and the cut card enclosed in brackets).
108 Play continues until one player reaches the game limit (61 or 121).
109 .Pp
110 A carriage return when a numeric input is expected is equivalent
111 to typing the lowest legal value; when cutting the deck this
112 is equivalent to choosing the top card.
113 .Pp
114 Cards are specified as rank followed by suit.
115 The ranks may be specified
116 as one of:
117 .Sq a ,
118 .Sq 2 ,
119 .Sq 3 ,
120 .Sq 4 ,
121 .Sq 5 ,
122 .Sq 6 ,
123 .Sq 7 ,
124 .Sq 8 ,
125 .Sq 9 ,
126 .Sq t ,
127 .Sq j ,
128 .Sq q ,
129 and
130 .Sq k ,
131 or alternatively, one of:
132 .Sq ace ,
133 .Sq two ,
134 .Sq three ,
135 .Sq four ,
136 .Sq five ,
137 .Sq six ,
138 .Sq seven ,
139 .Sq eight ,
140 .Sq nine ,
141 .Sq ten ,
142 .Sq jack ,
143 .Sq queen ,
144 and
145 .Sq king .
146 Suits may be specified as:
147 .Sq s ,
148 .Sq h ,
149 .Sq d ,
150 and
151 .Sq c ,
152 or alternatively as:
153 .Sq spades ,
154 .Sq hearts ,
155 .Sq diamonds ,
156 and
157 .Sq clubs .
158 A card may be specified as:
159 .Dq Ao rank Ac \  Aq suit ,
160 or:
161 .Dq Ao rank Ac of Aq suit .
162 If the single letter rank and suit designations are used, the space
163 separating the suit and rank may be left out.
164 Also, if only one card
165 of the desired rank is playable, typing the rank is sufficient.
166 For example, if your hand was
167 .Dq 2H, 4D, 5C, 6H, JC, and KD
168 and it was desired to discard the king of diamonds, any of
169 the following could be typed:
170 .Sq k ,
171 .Sq king ,
172 .Sq kd ,
173 .Sq k d ,
174 .Sq k of d ,
175 .Sq king d ,
176 .Sq king of d ,
177 .Sq k diamonds ,
178 .Sq k of diamonds ,
179 .Sq king diamonds ,
180 .Sq king of diamonds .
181 .Sh FILES
182 .Bl -tag -width ".Pa /usr/share/games/cribbage.instr" -compact
183 .It Pa /usr/games/cribbage
184 .It Pa /var/games/criblog
185 .It Pa /usr/share/games/cribbage.instr
186 .El
187 .Sh AUTHORS
188 .An -nosplit
189 .An Earl T. Cohen
190 wrote the logic.
191 .An Ken Arnold
192 added the screen oriented interface.