ANSIfication; bug report 4.3BSD/bin/223
[unix-history] / usr / src / games / cribbage / cribbage.6
CommitLineData
5ffc51f0 1.\" Copyright (c) 1980 Regents of the University of California.
e3910b60 2.\" All rights reserved.
5ffc51f0 3.\"
e3910b60 4.\" Redistribution and use in source and binary forms are permitted
57a981eb
KB
5.\" provided that the above copyright notice and this paragraph are
6.\" duplicated in all such forms and that any documentation,
7.\" advertising materials, and other materials related to such
8.\" distribution and use acknowledge that the software was developed
9.\" by the University of California, Berkeley. The name of the
10.\" University may not be used to endorse or promote products derived
11.\" from this software without specific prior written permission.
12.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14.\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
e3910b60 15.\"
57a981eb 16.\" @(#)cribbage.6 6.4 (Berkeley) %G%
5ffc51f0 17.\"
76aad035 18.TH CRIBBAGE 6 ""
5ffc51f0
KM
19.UC 4
20.SH NAME
21cribbage \- the card game cribbage
22.SH SYNOPSIS
23.B /usr/games/cribbage
24[
efbb7ae1
KM
25.B \-req
26]
27.I name ...
5ffc51f0
KM
28.SH DESCRIPTION
29.I Cribbage
30plays the card game cribbage, with the program playing one hand
31and the user the other. The program will initially ask the user if
efbb7ae1 32the rules of the game are needed \- if so, it will print out
5ffc51f0
KM
33the appropriate section from
34.I According to Hoyle
35with
36.I more (I).
37.PP
38.I Cribbage
39options include:
40.TP
41.B \-e
6bc80c78 42When the player makes a mistake scoring his hand or crib, provide an
5ffc51f0
KM
43explanation of the correct score. (This is especially useful for
44beginning players.)
45.TP
46.B \-q
efbb7ae1 47Print a shorter form of all messages \- this is only recommended for
5ffc51f0
KM
48users who have played the game without specifying this option.
49.TP
50.B \-r
51Instead of asking the player to cut the deck, the program will randomly
52cut the deck.
53.PP
54.I Cribbage
55first asks the player whether he wishes to play a short game
56(\*(lqonce around\*(rq, to 61) or a long game (\*(lqtwice around\*(rq, to 121). A
57response of `s' will result in a short game, any other response will
58play a long game.
59.PP
60At the start of the first game, the program
61asks the player to cut the deck to determine who gets the
62first crib. The user should respond with a number between 0 and
6351, indicating how many cards down the deck is to be cut. The player
64who cuts the lower ranked card gets the first crib.
65If more than one game is played, the
66loser of the previous game gets the first crib in the current game.
67.PP
68For each hand, the program first prints the player's hand,
69whose crib it is, and then asks the player
70to discard two cards into the crib. The cards are prompted for
71one per line, and are typed as explained below.
72.PP
73After discarding, the program cuts the deck (if it is the player's
6bc80c78 74crib) or asks the player to cut the deck (if it's its crib); in the latter
5ffc51f0
KM
75case, the appropriate response is a number from 0 to 39 indicating
76how far down the remaining 40 cards are to be cut.
77.PP
78After cutting the deck, play starts with the non-dealer (the person
79who doesn't have the crib) leading the first card.
80Play continues, as per cribbage, until all cards are exhausted. The
81program keeps track of the scoring of all points and the total of
82the cards on the table.
83.PP
84After play, the hands are scored. The program requests the player to
85score his hand (and the crib, if it is his) by printing out the
86appropriate cards (and the cut card enclosed in brackets).
87Play continues until one player reaches the game limit (61 or 121).
88.PP
89A carriage return when a numeric input is expected is equivalent
90to typing the lowest legal value; when cutting the deck this
91is equivalent to choosing the top card.
92.PP
93Cards are specified as rank followed by suit. The ranks may be specified
94as one of:
95`a', `2', `3', `4', `5', `6', `7', `8', `9', `t', `j', `q', and `k',
96or alternatively, one of: \*(lqace\*(rq, \*(lqtwo\*(rq, \*(lqthree\*(rq, \*(lqfour\*(rq, \*(lqfive\*(rq, \*(lqsix\*(rq,
97\*(lqseven\*(rq, \*(lqeight\*(rq, \*(lqnine\*(rq, \*(lqten\*(rq, \*(lqjack\*(rq, \*(lqqueen\*(rq, and \*(lqking\*(rq.
98Suits may be specified as: `s', `h', `d', and `c', or alternatively as:
99\*(lqspades\*(rq, \*(lqhearts\*(rq, \*(lqdiamonds\*(rq, and \*(lqclubs\*(rq.
100A card may be specified as: <rank> \*(lq \*(rq <suit>, or: <rank> \*(lq of \*(rq <suit>.
101If the single letter rank and suit designations are used, the space
102separating the suit and rank may be left out. Also, if only one card
103of the desired rank is playable, typing the rank is sufficient.
104For example, if your hand was \*(lq2H, 4D, 5C, 6H, JC, KD\*(rq and it was
105desired to discard the king of diamonds, any of the following could be typed:
106\*(lqk\*(rq, \*(lqking\*(rq, \*(lqkd\*(rq, \*(lqk d\*(rq, \*(lqk of d\*(rq, \*(lqking d\*(rq, \*(lqking of d\*(rq, \*(lqk diamonds\*(rq,
107\*(lqk of diamonds\*(rq, \*(lqking diamonds\*(rq, or \*(lqking of diamonds\*(rq.
108.SH FILES
109.ta 2i
110/usr/games/cribbage
efbb7ae1
KM
111.SH AUTHORS
112Earl T. Cohen wrote the logic.
113Ken Arnold added the screen oriented interface.