Commit | Line | Data |
---|---|---|
6693db17 | 1 | /*- |
984263bc MD |
2 | * Copyright (c) 1980, 1993 |
3 | * The Regents of the University of California. All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms, with or without | |
6 | * modification, are permitted provided that the following conditions | |
7 | * are met: | |
8 | * 1. Redistributions of source code must retain the above copyright | |
9 | * notice, this list of conditions and the following disclaimer. | |
10 | * 2. Redistributions in binary form must reproduce the above copyright | |
11 | * notice, this list of conditions and the following disclaimer in the | |
12 | * documentation and/or other materials provided with the distribution. | |
6693db17 | 13 | * 3. Neither the name of the University nor the names of its contributors |
984263bc MD |
14 | * may be used to endorse or promote products derived from this software |
15 | * without specific prior written permission. | |
16 | * | |
17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
27 | * SUCH DAMAGE. | |
28 | * | |
29 | * @(#)cribbage.h 8.1 (Berkeley) 5/31/93 | |
30 | */ | |
31 | ||
413c6806 | 32 | |
984263bc MD |
33 | extern CARD deck[ CARDS ]; /* a deck */ |
34 | extern CARD phand[ FULLHAND ]; /* player's hand */ | |
35 | extern CARD chand[ FULLHAND ]; /* computer's hand */ | |
36 | extern CARD crib[ CINHAND ]; /* the crib */ | |
37 | extern CARD turnover; /* the starter */ | |
38 | ||
39 | extern CARD known[ CARDS ]; /* cards we have seen */ | |
40 | extern int knownum; /* # of cards we know */ | |
41 | ||
42 | extern int pscore; /* player's score */ | |
43 | extern int cscore; /* comp's score */ | |
44 | extern int glimit; /* points to win game */ | |
45 | ||
46 | extern int pgames; /* player's games won */ | |
47 | extern int cgames; /* comp's games won */ | |
48 | extern int gamecount; /* # games played */ | |
49 | extern int Lastscore[2]; /* previous score for each */ | |
50 | ||
413c6806 EN |
51 | extern bool iwon; /* if comp won last */ |
52 | extern bool explain; /* player mistakes explained */ | |
53 | extern bool rflag; /* if all cuts random */ | |
54 | extern bool quiet; /* if suppress random mess */ | |
984263bc | 55 | |
413c6806 | 56 | extern char explstr[]; /* string for explanation */ |
984263bc | 57 | |
b58f1e66 | 58 | void addmsg(const char *, ...) __printflike(1, 2); |
6693db17 SW |
59 | int adjust(CARD []); |
60 | bool anymove(CARD [], int, int); | |
61 | void bye(void); | |
62 | int cchose(CARD [], int, int); | |
63 | void cdiscard(bool); | |
64 | bool chkscr(int *, int); | |
65 | bool comphand(CARD [], const char *); | |
66 | void cremove(CARD, CARD [], int); | |
67 | void do_wait(void); | |
68 | void endmsg(void); | |
cae2835b | 69 | char *get_line(void); |
6693db17 SW |
70 | int getuchar(void); |
71 | int infrom(CARD [], int, const char *); | |
72 | void instructions(void); | |
09ac707a | 73 | void intr(int) __dead2; |
6693db17 SW |
74 | bool isone(CARD, CARD [], int); |
75 | void makedeck(CARD []); | |
76 | void makeknown(CARD [], int); | |
b58f1e66 | 77 | void msg(const char *, ...) __printflike(1, 2); |
6693db17 SW |
78 | bool msgcard(CARD, bool); |
79 | int number(int, int, const char *); | |
80 | int pegscore(CARD, CARD [], int, int); | |
81 | bool plyrhand(CARD [], const char *); | |
82 | void prcard(WINDOW *, int, int, CARD, bool); | |
83 | void prhand(CARD [], int, WINDOW *, bool); | |
84 | int scorehand(CARD [], CARD, int, bool, bool); | |
85 | void shuffle(CARD []); | |
86 | void sorthand(CARD [], int); |