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