extern.c revision 1.4 1 1.4 cgd /* $NetBSD: extern.c,v 1.4 1995/03/24 05:01:36 cgd Exp $ */
2 1.4 cgd
3 1.1 cgd /*
4 1.3 jtc * Copyright (c) 1982, 1993
5 1.3 jtc * The Regents of the University of California. All rights reserved.
6 1.1 cgd *
7 1.1 cgd * Redistribution and use in source and binary forms, with or without
8 1.1 cgd * modification, are permitted provided that the following conditions
9 1.1 cgd * are met:
10 1.1 cgd * 1. Redistributions of source code must retain the above copyright
11 1.1 cgd * notice, this list of conditions and the following disclaimer.
12 1.1 cgd * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 cgd * notice, this list of conditions and the following disclaimer in the
14 1.1 cgd * documentation and/or other materials provided with the distribution.
15 1.1 cgd * 3. All advertising materials mentioning features or use of this software
16 1.1 cgd * must display the following acknowledgement:
17 1.1 cgd * This product includes software developed by the University of
18 1.1 cgd * California, Berkeley and its contributors.
19 1.1 cgd * 4. Neither the name of the University nor the names of its contributors
20 1.1 cgd * may be used to endorse or promote products derived from this software
21 1.1 cgd * without specific prior written permission.
22 1.1 cgd *
23 1.1 cgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 1.1 cgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 1.1 cgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 1.1 cgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 1.1 cgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 1.1 cgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 1.1 cgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 1.1 cgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 1.1 cgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 1.1 cgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 1.1 cgd * SUCH DAMAGE.
34 1.1 cgd */
35 1.1 cgd
36 1.1 cgd #ifndef lint
37 1.4 cgd #if 0
38 1.4 cgd static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93";
39 1.4 cgd #else
40 1.4 cgd static char rcsid[] = "$NetBSD: extern.c,v 1.4 1995/03/24 05:01:36 cgd Exp $";
41 1.4 cgd #endif
42 1.1 cgd #endif /* not lint */
43 1.1 cgd
44 1.1 cgd # include "mille.h"
45 1.1 cgd
46 1.1 cgd /*
47 1.1 cgd * @(#)extern.c 1.1 (Berkeley) 4/1/82
48 1.1 cgd */
49 1.1 cgd
50 1.1 cgd bool Debug, /* set if debugging code on */
51 1.1 cgd Finished, /* set if current hand is finished */
52 1.1 cgd Next, /* set if changing players */
53 1.1 cgd On_exit, /* set if game saved on exiting */
54 1.1 cgd Order, /* set if hand should be sorted */
55 1.1 cgd Saved; /* set if game just saved */
56 1.1 cgd
57 1.1 cgd char *C_fmt = "%-18.18s", /* format for printing cards */
58 1.1 cgd *Fromfile = NULL, /* startup file for game */
59 1.1 cgd Initstr[100], /* initial string for error field */
60 1.1 cgd *_cn[NUM_CARDS] = { /* Card name buffer */
61 1.1 cgd "",
62 1.1 cgd "25",
63 1.1 cgd "50",
64 1.1 cgd "75",
65 1.1 cgd "100",
66 1.1 cgd "200",
67 1.1 cgd "Out of Gas",
68 1.1 cgd "Flat Tire",
69 1.1 cgd "Accident",
70 1.1 cgd "Stop",
71 1.1 cgd "Speed Limit",
72 1.1 cgd "Gasoline",
73 1.1 cgd "Spare Tire",
74 1.1 cgd "Repairs",
75 1.1 cgd "Go",
76 1.1 cgd "End of Limit",
77 1.1 cgd "Extra Tank",
78 1.1 cgd "Puncture Proof",
79 1.1 cgd "Driving Ace",
80 1.1 cgd "Right of Way"
81 1.1 cgd },
82 1.1 cgd **C_name = &_cn[1]; /* Card names */
83 1.1 cgd
84 1.1 cgd int Card_no, /* Card number for current move */
85 1.1 cgd End, /* End value for current hand */
86 1.1 cgd Handstart = COMP, /* Player who starts hand */
87 1.1 cgd Movetype, /* Current move type */
88 1.1 cgd Play, /* Current player */
89 1.1 cgd Numgos, /* Number of Go cards used by computer */
90 1.1 cgd Window = W_SMALL, /* Current window wanted */
91 1.1 cgd Numseen[NUM_CARDS], /* Number of cards seen in current hand */
92 1.1 cgd Value[NUM_MILES] = { /* Value of mileage cards */
93 1.1 cgd 25, 50, 75, 100, 200
94 1.1 cgd },
95 1.1 cgd Numcards[NUM_CARDS] = { /* Number of cards in deck */
96 1.1 cgd 10, /* C_25 */
97 1.1 cgd 10, /* C_50 */
98 1.1 cgd 10, /* C_75 */
99 1.1 cgd 12, /* C_100 */
100 1.1 cgd 4, /* C_200 */
101 1.1 cgd 2, /* C_EMPTY */
102 1.1 cgd 2, /* C_FLAT */
103 1.1 cgd 2, /* C_CRASH */
104 1.1 cgd 4, /* C_STOP */
105 1.1 cgd 3, /* C_LIMIT */
106 1.1 cgd 6, /* C_GAS */
107 1.1 cgd 6, /* C_SPARE */
108 1.1 cgd 6, /* C_REPAIRS */
109 1.1 cgd 14, /* C_GO */
110 1.1 cgd 6, /* C_END_LIMIT */
111 1.1 cgd 1, /* C_GAS_SAFE */
112 1.1 cgd 1, /* C_SPARE_SAFE */
113 1.1 cgd 1, /* C_DRIVE_SAFE */
114 1.1 cgd 1, /* C_RIGHT_WAY */
115 1.1 cgd 0 /* C_INIT */
116 1.1 cgd },
117 1.1 cgd Numneed[NUM_CARDS] = { /* number of cards needed per hand */
118 1.1 cgd 0, /* C_25 */
119 1.1 cgd 0, /* C_50 */
120 1.1 cgd 0, /* C_75 */
121 1.1 cgd 0, /* C_100 */
122 1.1 cgd 0, /* C_200 */
123 1.1 cgd 2, /* C_EMPTY */
124 1.1 cgd 2, /* C_FLAT */
125 1.1 cgd 2, /* C_CRASH */
126 1.1 cgd 4, /* C_STOP */
127 1.1 cgd 3, /* C_LIMIT */
128 1.1 cgd 2, /* C_GAS */
129 1.1 cgd 2, /* C_SPARE */
130 1.1 cgd 2, /* C_REPAIRS */
131 1.1 cgd 10, /* C_GO */
132 1.1 cgd 3, /* C_END_LIMIT */
133 1.1 cgd 1, /* C_GAS_SAFE */
134 1.1 cgd 1, /* C_SPARE_SAFE */
135 1.1 cgd 1, /* C_DRIVE_SAFE */
136 1.1 cgd 1, /* C_RIGHT_WAY */
137 1.1 cgd 0 /* C_INIT */
138 1.1 cgd };
139 1.1 cgd
140 1.1 cgd CARD Discard, /* Top of discard pile */
141 1.1 cgd Sh_discard, /* Last discard card shown */
142 1.1 cgd *Topcard, /* Pointer to next card to be picked */
143 1.1 cgd Opposite[NUM_CARDS] = { /* Opposites of each card */
144 1.1 cgd C_25, C_50, C_75, C_100, C_200, C_GAS, C_SPARE,
145 1.1 cgd C_REPAIRS, C_GO, C_END_LIMIT, C_EMPTY, C_FLAT, C_CRASH,
146 1.1 cgd C_STOP, C_LIMIT, C_EMPTY, C_FLAT, C_CRASH, C_STOP, C_INIT
147 1.1 cgd },
148 1.1 cgd Deck[DECK_SZ] = { /* Current deck */
149 1.1 cgd C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25,
150 1.1 cgd C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50,
151 1.1 cgd C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75,
152 1.1 cgd C_100, C_100, C_100, C_100, C_100, C_100, C_100, C_100, C_100,
153 1.1 cgd C_100, C_100, C_100,
154 1.1 cgd C_200, C_200, C_200, C_200,
155 1.1 cgd C_EMPTY, C_EMPTY,
156 1.1 cgd C_FLAT, C_FLAT,
157 1.1 cgd C_CRASH, C_CRASH,
158 1.1 cgd C_STOP, C_STOP, C_STOP, C_STOP,
159 1.1 cgd C_LIMIT, C_LIMIT, C_LIMIT,
160 1.1 cgd C_GAS, C_GAS, C_GAS, C_GAS, C_GAS, C_GAS,
161 1.1 cgd C_SPARE, C_SPARE, C_SPARE, C_SPARE, C_SPARE, C_SPARE,
162 1.1 cgd C_REPAIRS, C_REPAIRS, C_REPAIRS, C_REPAIRS, C_REPAIRS,
163 1.1 cgd C_REPAIRS,
164 1.1 cgd C_END_LIMIT, C_END_LIMIT, C_END_LIMIT, C_END_LIMIT, C_END_LIMIT,
165 1.1 cgd C_END_LIMIT,
166 1.1 cgd C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO,
167 1.1 cgd C_GO, C_GO, C_GO, C_GO,
168 1.1 cgd C_GAS_SAFE, C_SPARE_SAFE, C_DRIVE_SAFE, C_RIGHT_WAY
169 1.1 cgd };
170 1.1 cgd
171 1.1 cgd FILE *outf;
172 1.1 cgd
173 1.1 cgd PLAY Player[2]; /* Player descriptions */
174 1.1 cgd
175 1.1 cgd WINDOW *Board, /* Playing field screen */
176 1.1 cgd *Miles, /* Mileage screen */
177 1.1 cgd *Score; /* Score screen */
178 1.1 cgd
179