1.\" $NetBSD: cribbage.6,v 1.12 2023/01/06 17:13:46 christos 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 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 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 are 46needed \(en if so, it will print out the appropriate section from 47.Em According to Hoyle 48with 49.Xr more 1 . 50.Pp 51.Nm 52options include: 53.Bl -tag -width indent 54.It Fl e 55When the player makes a mistake scoring his hand or crib, provide an 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 60users who have played the game without specifying this option. 61.It Fl r 62Instead of asking the player to cut the deck, the program will randomly 63cut the deck. 64.It Fl y 65Assume 'Y' to the query for another game if 'Y' is not explicitly typed 66(default is to exit unless 'Y' is typed). 67.El 68.Pp 69.Nm 70first asks the player whether he wishes to play a short game ( 71.Dq once around , 72to 61) or a long game ( 73.Dq twice around , 74to 121). 75A response of 76.Sq Ic s 77will result in a short game, any other response will play a long game. 78.Pp 79At the start of the first game, the program 80asks the player to cut the deck to determine who gets the first crib. 81The user should respond with a number between 0 and 8251, indicating how many cards down the deck is to be cut. 83The player who cuts the lower ranked card gets the first crib. 84If more than one game is played, the 85loser of the previous game gets the first crib in the current game. 86.Pp 87For each hand, the program first prints the player's hand, 88whose crib it is, and then asks the player 89to discard two cards into the crib. 90The cards are prompted for one per line, and are typed as explained below. 91.Pp 92After discarding, the program cuts the deck (if it is the player's 93crib) or asks the player to cut the deck (if it's its crib); in the latter 94case, the appropriate response is a number from 0 to 39 indicating 95how far down the remaining 40 cards are to be cut. 96.Pp 97After cutting the deck, play starts with the non-dealer (the person 98who doesn't have the crib) leading the first card. 99Play continues, as per cribbage, until all cards are exhausted. 100The program keeps track of the scoring of all points and the total of 101the cards on the table. 102.Pp 103After play, the hands are scored. 104The program requests the player to 105score his hand (and the crib, if it is his) by printing out the 106appropriate cards (and the cut card enclosed in brackets). 107Play continues until one player reaches the game limit (61 or 121). 108.Pp 109A carriage return when a numeric input is expected is equivalent 110to typing the lowest legal value; when cutting the deck this 111is equivalent to choosing the top card. 112.Pp 113Cards are specified as rank followed by suit. 114The 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. 163Also, if only one card 164of the desired rank is playable, typing the rank is sufficient. 165For example, if your hand was 166.Dq 2H, 4D, 5C, 6H, JC, and KD 167and it was desired to discard the king of diamonds, any of 168the following could be typed: 169.Sq k , 170.Sq king , 171.Sq kd , 172.Sq k d , 173.Sq k of d , 174.Sq king d , 175.Sq king of d , 176.Sq k diamonds , 177.Sq k of diamonds , 178.Sq king diamonds , 179.Sq king of diamonds . 180.Sh FILES 181.Bl -tag -width /usr/share/games/cribbage.instr -compact 182.It Pa /usr/games/cribbage 183.It Pa /var/games/criblog 184.It Pa /usr/share/games/cribbage.instr 185.El 186.Sh AUTHORS 187Earl T. Cohen wrote the logic. 188Ken Arnold added the screen oriented interface. 189