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