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