1 .\" $NetBSD: cribbage.6,v 1.10 2002/09/30 12:43:22 wiz Exp $
3 .\" Copyright (c) 1980, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
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.
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
30 .\" @(#)cribbage.6 8.1 (Berkeley) 5/31/93
37 .Nd the card game cribbage
43 plays the card game cribbage, with the program playing one hand
44 and the user the other.
45 The program will initially ask the user if the rules of the game are
46 needed \(en if so, it will print out the appropriate section from
47 .Em According to Hoyle
53 .Bl -tag -width indent
55 When the player makes a mistake scoring his hand or crib, provide an
56 explanation of the correct score.
57 (This is especially useful for beginning players.)
59 Print a shorter form of all messages \(en this is only recommended for
60 users who have played the game without specifying this option.
62 Instead of asking the player to cut the deck, the program will randomly
67 first asks the player whether he wishes to play a short game (
69 to 61) or a long game (
74 will result in a short game, any other response will play a long game.
76 At the start of the first game, the program
77 asks the player to cut the deck to determine who gets the first crib.
78 The user should respond with a number between 0 and
79 51, indicating how many cards down the deck is to be cut.
80 The player who cuts the lower ranked card gets the first crib.
81 If more than one game is played, the
82 loser of the previous game gets the first crib in the current game.
84 For each hand, the program first prints the player's hand,
85 whose crib it is, and then asks the player
86 to discard two cards into the crib.
87 The cards are prompted for one per line, and are typed as explained below.
89 After discarding, the program cuts the deck (if it is the player's
90 crib) or asks the player to cut the deck (if it's its crib); in the latter
91 case, the appropriate response is a number from 0 to 39 indicating
92 how far down the remaining 40 cards are to be cut.
94 After cutting the deck, play starts with the non-dealer (the person
95 who doesn't have the crib) leading the first card.
96 Play continues, as per cribbage, until all cards are exhausted.
97 The program keeps track of the scoring of all points and the total of
98 the cards on the table.
100 After play, the hands are scored.
101 The program requests the player to
102 score his hand (and the crib, if it is his) by printing out the
103 appropriate cards (and the cut card enclosed in brackets).
104 Play continues until one player reaches the game limit (61 or 121).
106 A carriage return when a numeric input is expected is equivalent
107 to typing the lowest legal value; when cutting the deck this
108 is equivalent to choosing the top card.
110 Cards are specified as rank followed by suit.
111 The ranks may be specified
127 or alternatively, one of:
142 Suits may be specified as:
154 A card may be specified as:
155 .Dq Ao rank Ac \ Aq suit ,
157 .Dq Ao rank Ac of Aq suit .
158 If the single letter rank and suit designations are used, the space
159 separating the suit and rank may be left out.
160 Also, if only one card
161 of the desired rank is playable, typing the rank is sufficient.
162 For example, if your hand was
163 .Dq 2H, 4D, 5C, 6H, JC, and KD
164 and it was desired to discard the king of diamonds, any of
165 the following could be typed:
176 .Sq king of diamonds .
178 .Bl -tag -width /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
184 Earl T. Cohen wrote the logic.
185 Ken Arnold added the screen oriented interface.