xref: /original-bsd/games/mille/extern.c (revision 83e03edb)
1 /*
2  * Copyright (c) 1982 Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that the above copyright notice and this paragraph are
7  * duplicated in all such forms and that any documentation,
8  * advertising materials, and other materials related to such
9  * distribution and use acknowledge that the software was developed
10  * by the University of California, Berkeley.  The name of the
11  * University may not be used to endorse or promote products derived
12  * from this software without specific prior written permission.
13  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16  */
17 
18 #ifndef lint
19 static char sccsid[] = "@(#)extern.c	5.4 (Berkeley) 06/18/88";
20 #endif /* not lint */
21 
22 # include	"mille.h"
23 
24 /*
25  * @(#)extern.c	1.1 (Berkeley) 4/1/82
26  */
27 
28 bool	Debug,			/* set if debugging code on		*/
29 	Finished,		/* set if current hand is finished	*/
30 	Next,			/* set if changing players		*/
31 	On_exit,		/* set if game saved on exiting		*/
32 	Order,			/* set if hand should be sorted		*/
33 	Saved;			/* set if game just saved		*/
34 
35 char	*C_fmt = "%-18.18s",	/* format for printing cards		*/
36 	*Fromfile = NULL,	/* startup file for game		*/
37 	Initstr[100],		/* initial string for error field	*/
38 	*_cn[NUM_CARDS] = {	/* Card name buffer			*/
39 		"",
40 		"25",
41 		"50",
42 		"75",
43 		"100",
44 		"200",
45 		"Out of Gas",
46 		"Flat Tire",
47 		"Accident",
48 		"Stop",
49 		"Speed Limit",
50 		"Gasoline",
51 		"Spare Tire",
52 		"Repairs",
53 		"Go",
54 		"End of Limit",
55 		"Extra Tank",
56 		"Puncture Proof",
57 		"Driving Ace",
58 		"Right of Way"
59 	},
60 	**C_name = &_cn[1];	/* Card names				*/
61 
62 int	Card_no,		/* Card number for current move		*/
63 	End,			/* End value for current hand		*/
64 	Handstart = COMP,	/* Player who starts hand		*/
65 	Movetype,		/* Current move type			*/
66 	Play,			/* Current player			*/
67 	Numgos,			/* Number of Go cards used by computer	*/
68 	Window = W_SMALL,	/* Current window wanted		*/
69 	Numseen[NUM_CARDS],	/* Number of cards seen in current hand	*/
70 	Value[NUM_MILES] = {	/* Value of mileage cards		*/
71 		25, 50, 75, 100, 200
72 	},
73 	Numcards[NUM_CARDS] = {	/* Number of cards in deck		*/
74 		10,	/* C_25 */
75 		10,	/* C_50 */
76 		10,	/* C_75 */
77 		12,	/* C_100 */
78 		4,	/* C_200 */
79 		2,	/* C_EMPTY */
80 		2,	/* C_FLAT */
81 		2,	/* C_CRASH */
82 		4,	/* C_STOP */
83 		3,	/* C_LIMIT */
84 		6,	/* C_GAS */
85 		6,	/* C_SPARE */
86 		6,	/* C_REPAIRS */
87 		14,	/* C_GO */
88 		6,	/* C_END_LIMIT */
89 		1,	/* C_GAS_SAFE */
90 		1,	/* C_SPARE_SAFE */
91 		1,	/* C_DRIVE_SAFE */
92 		1,	/* C_RIGHT_WAY */
93 		0	/* C_INIT */
94 	},
95 	Numneed[NUM_CARDS] = {	/* number of cards needed per hand	*/
96 		0,	/* C_25 */
97 		0,	/* C_50 */
98 		0,	/* C_75 */
99 		0,	/* C_100 */
100 		0,	/* C_200 */
101 		2,	/* C_EMPTY */
102 		2,	/* C_FLAT */
103 		2,	/* C_CRASH */
104 		4,	/* C_STOP */
105 		3,	/* C_LIMIT */
106 		2,	/* C_GAS */
107 		2,	/* C_SPARE */
108 		2,	/* C_REPAIRS */
109 		10,	/* C_GO */
110 		3,	/* C_END_LIMIT */
111 		1,	/* C_GAS_SAFE */
112 		1,	/* C_SPARE_SAFE */
113 		1,	/* C_DRIVE_SAFE */
114 		1,	/* C_RIGHT_WAY */
115 		0	/* C_INIT */
116 	};
117 
118 CARD	Discard,		/* Top of discard pile			*/
119 	Sh_discard,		/* Last discard card shown		*/
120 	*Topcard,		/* Pointer to next card to be picked	*/
121 	Opposite[NUM_CARDS] = {	/* Opposites of each card		*/
122 		C_25, C_50, C_75, C_100, C_200, C_GAS, C_SPARE,
123 		C_REPAIRS, C_GO, C_END_LIMIT, C_EMPTY, C_FLAT, C_CRASH,
124 		C_STOP, C_LIMIT, C_EMPTY, C_FLAT, C_CRASH, C_STOP, C_INIT
125 	},
126 	Deck[DECK_SZ] = {	/* Current deck				*/
127 		C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25,
128 		C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50,
129 		C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75,
130 		C_100, C_100, C_100, C_100, C_100, C_100, C_100, C_100, C_100,
131 		C_100, C_100, C_100,
132 		C_200, C_200, C_200, C_200,
133 		C_EMPTY, C_EMPTY,
134 		C_FLAT, C_FLAT,
135 		C_CRASH, C_CRASH,
136 		C_STOP, C_STOP, C_STOP, C_STOP,
137 		C_LIMIT, C_LIMIT, C_LIMIT,
138 		C_GAS, C_GAS, C_GAS, C_GAS, C_GAS, C_GAS,
139 		C_SPARE, C_SPARE, C_SPARE, C_SPARE, C_SPARE, C_SPARE,
140 		C_REPAIRS, C_REPAIRS, C_REPAIRS, C_REPAIRS, C_REPAIRS,
141 			C_REPAIRS,
142 		C_END_LIMIT, C_END_LIMIT, C_END_LIMIT, C_END_LIMIT, C_END_LIMIT,
143 			C_END_LIMIT,
144 		C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO,
145 			C_GO, C_GO, C_GO, C_GO,
146 		C_GAS_SAFE, C_SPARE_SAFE, C_DRIVE_SAFE, C_RIGHT_WAY
147 	};
148 
149 FILE	*outf;
150 
151 PLAY	Player[2];		/* Player descriptions			*/
152 
153 WINDOW	*Board,			/* Playing field screen			*/
154 	*Miles,			/* Mileage screen			*/
155 	*Score;			/* Score screen				*/
156 
157