]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - cribbage/cribbage.h
1 /* $NetBSD: cribbage.h,v 1.3 1995/03/21 15:08:46 cgd Exp $ */
4 * Copyright (c) 1980, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by the University of
18 * California, Berkeley and its contributors.
19 * 4. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * @(#)cribbage.h 8.1 (Berkeley) 5/31/93
38 extern CARD deck
[ CARDS
]; /* a deck */
39 extern CARD phand
[ FULLHAND
]; /* player's hand */
40 extern CARD chand
[ FULLHAND
]; /* computer's hand */
41 extern CARD crib
[ CINHAND
]; /* the crib */
42 extern CARD turnover
; /* the starter */
44 extern CARD known
[ CARDS
]; /* cards we have seen */
45 extern int knownum
; /* # of cards we know */
47 extern int pscore
; /* player's score */
48 extern int cscore
; /* comp's score */
49 extern int glimit
; /* points to win game */
51 extern int pgames
; /* player's games won */
52 extern int cgames
; /* comp's games won */
53 extern int gamecount
; /* # games played */
54 extern int Lastscore
[2]; /* previous score for each */
56 extern BOOLEAN iwon
; /* if comp won last */
57 extern BOOLEAN explain
; /* player mistakes explained */
58 extern BOOLEAN rflag
; /* if all cuts random */
59 extern BOOLEAN quiet
; /* if suppress random mess */
60 extern BOOLEAN playing
; /* currently playing game */
62 extern char expl
[]; /* string for explanation */
64 void addmsg
__P((const char *, ...));
65 int adjust
__P((CARD
[], CARD
));
66 int anymove
__P((CARD
[], int, int));
67 int anysumto
__P((CARD
[], int, int, int));
69 int cchose
__P((CARD
[], int, int));
70 void cdiscard
__P((BOOLEAN
));
71 int chkscr
__P((int *, int));
72 int comphand
__P((CARD
[], char *));
73 void cremove
__P((CARD
, CARD
[], int));
74 int cut
__P((BOOLEAN
, int));
76 void discard
__P((BOOLEAN
));
77 void do_wait
__P((void));
78 void endmsg
__P((void));
79 int eq
__P((CARD
, CARD
));
80 int fifteens
__P((CARD
[], int));
81 void game
__P((void));
82 void gamescore
__P((void));
83 char *getline
__P((void));
84 int getuchar
__P((void));
85 int incard
__P((CARD
*));
86 int infrom
__P((CARD
[], int, char *));
87 void instructions
__P((void));
88 int isone
__P((CARD
, CARD
[], int));
89 void makeboard
__P((void));
90 void makedeck
__P((CARD
[]));
91 void makeknown
__P((CARD
[], int));
92 void msg
__P((const char *, ...));
93 int msgcard
__P((CARD
, BOOLEAN
));
94 int msgcrd
__P((CARD
, BOOLEAN
, char *, BOOLEAN
));
95 int number
__P((int, int, char *));
96 int numofval
__P((CARD
[], int, int));
97 int pairuns
__P((CARD
[], int));
98 int peg
__P((BOOLEAN
));
99 int pegscore
__P((CARD
, CARD
[], int, int));
100 int playhand
__P((BOOLEAN
));
101 int plyrhand
__P((CARD
[], char *));
102 void prcard
__P((WINDOW
*, int, int, CARD
, BOOLEAN
));
103 void prcrib
__P((BOOLEAN
, BOOLEAN
));
104 void prhand
__P((CARD
[], int, WINDOW
*, BOOLEAN
));
105 void printcard
__P((WINDOW
*, int, CARD
, BOOLEAN
));
106 void prpeg
__P((int, int, BOOLEAN
));
107 void prtable
__P((int));
108 int readchar
__P((void));
109 void rint
__P((int));
110 int score
__P((BOOLEAN
));
111 int scorehand
__P((CARD
[], CARD
, int, BOOLEAN
, BOOLEAN
));
112 void shuffle
__P((CARD
[]));
113 void sorthand
__P((CARD
[], int));
114 void wait_for
__P((int));