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