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