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