|
|
1.1 ! root 1: .\" Copyright (c) 1980 Regents of the University of California. ! 2: .\" All rights reserved. ! 3: .\" ! 4: .\" Redistribution and use in source and binary forms are permitted ! 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. ! 15: .\" ! 16: .\" @(#)cribbage.6 6.4 (Berkeley) 7/9/88 ! 17: .\" ! 18: .TH CRIBBAGE 6 "July 9, 1988" ! 19: .UC 4 ! 20: .SH NAME ! 21: cribbage \- the card game cribbage ! 22: .SH SYNOPSIS ! 23: .B /usr/games/cribbage ! 24: [ ! 25: .B \-req ! 26: ] ! 27: .I name ... ! 28: .SH DESCRIPTION ! 29: .I Cribbage ! 30: plays the card game cribbage, with the program playing one hand ! 31: and the user the other. The program will initially ask the user if ! 32: the rules of the game are needed \- if so, it will print out ! 33: the appropriate section from ! 34: .I According to Hoyle ! 35: with ! 36: .I more (I). ! 37: .PP ! 38: .I Cribbage ! 39: options include: ! 40: .TP ! 41: .B \-e ! 42: When the player makes a mistake scoring his hand or crib, provide an ! 43: explanation of the correct score. (This is especially useful for ! 44: beginning players.) ! 45: .TP ! 46: .B \-q ! 47: Print a shorter form of all messages \- this is only recommended for ! 48: users who have played the game without specifying this option. ! 49: .TP ! 50: .B \-r ! 51: Instead of asking the player to cut the deck, the program will randomly ! 52: cut the deck. ! 53: .PP ! 54: .I Cribbage ! 55: first 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 ! 57: response of `s' will result in a short game, any other response will ! 58: play a long game. ! 59: .PP ! 60: At the start of the first game, the program ! 61: asks the player to cut the deck to determine who gets the ! 62: first crib. The user should respond with a number between 0 and ! 63: 51, indicating how many cards down the deck is to be cut. The player ! 64: who cuts the lower ranked card gets the first crib. ! 65: If more than one game is played, the ! 66: loser of the previous game gets the first crib in the current game. ! 67: .PP ! 68: For each hand, the program first prints the player's hand, ! 69: whose crib it is, and then asks the player ! 70: to discard two cards into the crib. The cards are prompted for ! 71: one per line, and are typed as explained below. ! 72: .PP ! 73: After discarding, the program cuts the deck (if it is the player's ! 74: crib) or asks the player to cut the deck (if it's its crib); in the latter ! 75: case, the appropriate response is a number from 0 to 39 indicating ! 76: how far down the remaining 40 cards are to be cut. ! 77: .PP ! 78: After cutting the deck, play starts with the non-dealer (the person ! 79: who doesn't have the crib) leading the first card. ! 80: Play continues, as per cribbage, until all cards are exhausted. The ! 81: program keeps track of the scoring of all points and the total of ! 82: the cards on the table. ! 83: .PP ! 84: After play, the hands are scored. The program requests the player to ! 85: score his hand (and the crib, if it is his) by printing out the ! 86: appropriate cards (and the cut card enclosed in brackets). ! 87: Play continues until one player reaches the game limit (61 or 121). ! 88: .PP ! 89: A carriage return when a numeric input is expected is equivalent ! 90: to typing the lowest legal value; when cutting the deck this ! 91: is equivalent to choosing the top card. ! 92: .PP ! 93: Cards are specified as rank followed by suit. The ranks may be specified ! 94: as one of: ! 95: `a', `2', `3', `4', `5', `6', `7', `8', `9', `t', `j', `q', and `k', ! 96: or 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. ! 98: Suits may be specified as: `s', `h', `d', and `c', or alternatively as: ! 99: \*(lqspades\*(rq, \*(lqhearts\*(rq, \*(lqdiamonds\*(rq, and \*(lqclubs\*(rq. ! 100: A card may be specified as: <rank> \*(lq \*(rq <suit>, or: <rank> \*(lq of \*(rq <suit>. ! 101: If the single letter rank and suit designations are used, the space ! 102: separating the suit and rank may be left out. Also, if only one card ! 103: of the desired rank is playable, typing the rank is sufficient. ! 104: For example, if your hand was \*(lq2H, 4D, 5C, 6H, JC, KD\*(rq and it was ! 105: desired 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 ! 111: .SH AUTHORS ! 112: Earl T. Cohen wrote the logic. ! 113: Ken Arnold added the screen oriented interface.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.