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