xref: /csrg-svn/games/mille/extern.c (revision 30200)
1*30200Sbostic /*
2*30200Sbostic  * Copyright (c) 1982 Regents of the University of California.
3*30200Sbostic  * All rights reserved.  The Berkeley software License Agreement
4*30200Sbostic  * specifies the terms and conditions for redistribution.
5*30200Sbostic  */
6*30200Sbostic 
7*30200Sbostic #ifndef lint
8*30200Sbostic static char sccsid[] = "@(#)extern.c	5.1 (Berkeley) 11/26/86";
9*30200Sbostic #endif not lint
10*30200Sbostic 
11*30200Sbostic # include	"mille.h"
12*30200Sbostic 
13*30200Sbostic /*
14*30200Sbostic  * @(#)extern.c	1.1 (Berkeley) 4/1/82
15*30200Sbostic  */
16*30200Sbostic 
17*30200Sbostic bool	Debug,			/* set if debugging code on		*/
18*30200Sbostic 	Finished,		/* set if current hand is finished	*/
19*30200Sbostic 	Next,			/* set if changing players		*/
20*30200Sbostic 	On_exit,		/* set if game saved on exiting		*/
21*30200Sbostic 	Order,			/* set if hand should be sorted		*/
22*30200Sbostic 	Saved;			/* set if game just saved		*/
23*30200Sbostic 
24*30200Sbostic char	*C_fmt = "%-18.18s",	/* format for printing cards		*/
25*30200Sbostic 	*Fromfile = NULL,	/* startup file for game		*/
26*30200Sbostic 	Initstr[100],		/* initial string for error field	*/
27*30200Sbostic 	*_cn[NUM_CARDS] = {	/* Card name buffer			*/
28*30200Sbostic 		"",
29*30200Sbostic 		"25",
30*30200Sbostic 		"50",
31*30200Sbostic 		"75",
32*30200Sbostic 		"100",
33*30200Sbostic 		"200",
34*30200Sbostic 		"Out of Gas",
35*30200Sbostic 		"Flat Tire",
36*30200Sbostic 		"Accident",
37*30200Sbostic 		"Stop",
38*30200Sbostic 		"Speed Limit",
39*30200Sbostic 		"Gasoline",
40*30200Sbostic 		"Spare Tire",
41*30200Sbostic 		"Repairs",
42*30200Sbostic 		"Go",
43*30200Sbostic 		"End of Limit",
44*30200Sbostic 		"Extra Tank",
45*30200Sbostic 		"Puncture Proof",
46*30200Sbostic 		"Driving Ace",
47*30200Sbostic 		"Right of Way"
48*30200Sbostic 	},
49*30200Sbostic 	**C_name = &_cn[1];	/* Card names				*/
50*30200Sbostic 
51*30200Sbostic int	Card_no,		/* Card number for current move		*/
52*30200Sbostic 	End,			/* End value for current hand		*/
53*30200Sbostic 	Handstart = COMP,	/* Player who starts hand		*/
54*30200Sbostic 	Movetype,		/* Current move type			*/
55*30200Sbostic 	Play,			/* Current player			*/
56*30200Sbostic 	Numgos,			/* Number of Go cards used by computer	*/
57*30200Sbostic 	Window = W_SMALL,	/* Current window wanted		*/
58*30200Sbostic 	Numseen[NUM_CARDS],	/* Number of cards seen in current hand	*/
59*30200Sbostic 	Value[NUM_MILES] = {	/* Value of mileage cards		*/
60*30200Sbostic 		25, 50, 75, 100, 200
61*30200Sbostic 	},
62*30200Sbostic 	Numcards[NUM_CARDS] = {	/* Number of cards in deck		*/
63*30200Sbostic 		10,	/* C_25 */
64*30200Sbostic 		10,	/* C_50 */
65*30200Sbostic 		10,	/* C_75 */
66*30200Sbostic 		12,	/* C_100 */
67*30200Sbostic 		4,	/* C_200 */
68*30200Sbostic 		2,	/* C_EMPTY */
69*30200Sbostic 		2,	/* C_FLAT */
70*30200Sbostic 		2,	/* C_CRASH */
71*30200Sbostic 		4,	/* C_STOP */
72*30200Sbostic 		3,	/* C_LIMIT */
73*30200Sbostic 		6,	/* C_GAS */
74*30200Sbostic 		6,	/* C_SPARE */
75*30200Sbostic 		6,	/* C_REPAIRS */
76*30200Sbostic 		14,	/* C_GO */
77*30200Sbostic 		6,	/* C_END_LIMIT */
78*30200Sbostic 		1,	/* C_GAS_SAFE */
79*30200Sbostic 		1,	/* C_SPARE_SAFE */
80*30200Sbostic 		1,	/* C_DRIVE_SAFE */
81*30200Sbostic 		1,	/* C_RIGHT_WAY */
82*30200Sbostic 		0	/* C_INIT */
83*30200Sbostic 	};
84*30200Sbostic 	Numneed[NUM_CARDS] = {	/* number of cards needed per hand	*/
85*30200Sbostic 		0,	/* C_25 */
86*30200Sbostic 		0,	/* C_50 */
87*30200Sbostic 		0,	/* C_75 */
88*30200Sbostic 		0,	/* C_100 */
89*30200Sbostic 		0,	/* C_200 */
90*30200Sbostic 		2,	/* C_EMPTY */
91*30200Sbostic 		2,	/* C_FLAT */
92*30200Sbostic 		2,	/* C_CRASH */
93*30200Sbostic 		4,	/* C_STOP */
94*30200Sbostic 		3,	/* C_LIMIT */
95*30200Sbostic 		2,	/* C_GAS */
96*30200Sbostic 		2,	/* C_SPARE */
97*30200Sbostic 		2,	/* C_REPAIRS */
98*30200Sbostic 		10,	/* C_GO */
99*30200Sbostic 		3,	/* C_END_LIMIT */
100*30200Sbostic 		1,	/* C_GAS_SAFE */
101*30200Sbostic 		1,	/* C_SPARE_SAFE */
102*30200Sbostic 		1,	/* C_DRIVE_SAFE */
103*30200Sbostic 		1,	/* C_RIGHT_WAY */
104*30200Sbostic 		0	/* C_INIT */
105*30200Sbostic 	};
106*30200Sbostic 
107*30200Sbostic CARD	Discard,		/* Top of discard pile			*/
108*30200Sbostic 	Sh_discard,		/* Last discard card shown		*/
109*30200Sbostic 	*Topcard,		/* Pointer to next card to be picked	*/
110*30200Sbostic 	Opposite[NUM_CARDS] = {	/* Opposites of each card		*/
111*30200Sbostic 		C_25, C_50, C_75, C_100, C_200, C_GAS, C_SPARE,
112*30200Sbostic 		C_REPAIRS, C_GO, C_END_LIMIT, C_EMPTY, C_FLAT, C_CRASH,
113*30200Sbostic 		C_STOP, C_LIMIT, C_EMPTY, C_FLAT, C_CRASH, C_STOP, C_INIT
114*30200Sbostic 	},
115*30200Sbostic 	Deck[DECK_SZ] = {	/* Current deck				*/
116*30200Sbostic 		C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25,
117*30200Sbostic 		C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50,
118*30200Sbostic 		C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75,
119*30200Sbostic 		C_100, C_100, C_100, C_100, C_100, C_100, C_100, C_100, C_100,
120*30200Sbostic 		C_100, C_100, C_100,
121*30200Sbostic 		C_200, C_200, C_200, C_200,
122*30200Sbostic 		C_EMPTY, C_EMPTY,
123*30200Sbostic 		C_FLAT, C_FLAT,
124*30200Sbostic 		C_CRASH, C_CRASH,
125*30200Sbostic 		C_STOP, C_STOP, C_STOP, C_STOP,
126*30200Sbostic 		C_LIMIT, C_LIMIT, C_LIMIT,
127*30200Sbostic 		C_GAS, C_GAS, C_GAS, C_GAS, C_GAS, C_GAS,
128*30200Sbostic 		C_SPARE, C_SPARE, C_SPARE, C_SPARE, C_SPARE, C_SPARE,
129*30200Sbostic 		C_REPAIRS, C_REPAIRS, C_REPAIRS, C_REPAIRS, C_REPAIRS,
130*30200Sbostic 			C_REPAIRS,
131*30200Sbostic 		C_END_LIMIT, C_END_LIMIT, C_END_LIMIT, C_END_LIMIT, C_END_LIMIT,
132*30200Sbostic 			C_END_LIMIT,
133*30200Sbostic 		C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO,
134*30200Sbostic 			C_GO, C_GO, C_GO, C_GO,
135*30200Sbostic 		C_GAS_SAFE, C_SPARE_SAFE, C_DRIVE_SAFE, C_RIGHT_WAY
136*30200Sbostic 	};
137*30200Sbostic 
138*30200Sbostic FILE	*outf;
139*30200Sbostic 
140*30200Sbostic PLAY	Player[2];		/* Player descriptions			*/
141*30200Sbostic 
142*30200Sbostic WINDOW	*Board,			/* Playing field screen			*/
143*30200Sbostic 	*Miles,			/* Mileage screen			*/
144*30200Sbostic 	*Score;			/* Score screen				*/
145*30200Sbostic 
146