xref: /csrg-svn/games/mille/extern.c (revision 33172)
130200Sbostic /*
230200Sbostic  * Copyright (c) 1982 Regents of the University of California.
3*33172Sbostic  * All rights reserved.
4*33172Sbostic  *
5*33172Sbostic  * Redistribution and use in source and binary forms are permitted
6*33172Sbostic  * provided that this notice is preserved and that due credit is given
7*33172Sbostic  * to the University of California at Berkeley. The name of the University
8*33172Sbostic  * may not be used to endorse or promote products derived from this
9*33172Sbostic  * software without specific prior written permission. This software
10*33172Sbostic  * is provided ``as is'' without express or implied warranty.
1130200Sbostic  */
1230200Sbostic 
1330200Sbostic #ifndef lint
14*33172Sbostic static char sccsid[] = "@(#)extern.c	5.2 (Berkeley) 12/29/87";
15*33172Sbostic #endif /* not lint */
1630200Sbostic 
1730200Sbostic # include	"mille.h"
1830200Sbostic 
1930200Sbostic /*
2030200Sbostic  * @(#)extern.c	1.1 (Berkeley) 4/1/82
2130200Sbostic  */
2230200Sbostic 
2330200Sbostic bool	Debug,			/* set if debugging code on		*/
2430200Sbostic 	Finished,		/* set if current hand is finished	*/
2530200Sbostic 	Next,			/* set if changing players		*/
2630200Sbostic 	On_exit,		/* set if game saved on exiting		*/
2730200Sbostic 	Order,			/* set if hand should be sorted		*/
2830200Sbostic 	Saved;			/* set if game just saved		*/
2930200Sbostic 
3030200Sbostic char	*C_fmt = "%-18.18s",	/* format for printing cards		*/
3130200Sbostic 	*Fromfile = NULL,	/* startup file for game		*/
3230200Sbostic 	Initstr[100],		/* initial string for error field	*/
3330200Sbostic 	*_cn[NUM_CARDS] = {	/* Card name buffer			*/
3430200Sbostic 		"",
3530200Sbostic 		"25",
3630200Sbostic 		"50",
3730200Sbostic 		"75",
3830200Sbostic 		"100",
3930200Sbostic 		"200",
4030200Sbostic 		"Out of Gas",
4130200Sbostic 		"Flat Tire",
4230200Sbostic 		"Accident",
4330200Sbostic 		"Stop",
4430200Sbostic 		"Speed Limit",
4530200Sbostic 		"Gasoline",
4630200Sbostic 		"Spare Tire",
4730200Sbostic 		"Repairs",
4830200Sbostic 		"Go",
4930200Sbostic 		"End of Limit",
5030200Sbostic 		"Extra Tank",
5130200Sbostic 		"Puncture Proof",
5230200Sbostic 		"Driving Ace",
5330200Sbostic 		"Right of Way"
5430200Sbostic 	},
5530200Sbostic 	**C_name = &_cn[1];	/* Card names				*/
5630200Sbostic 
5730200Sbostic int	Card_no,		/* Card number for current move		*/
5830200Sbostic 	End,			/* End value for current hand		*/
5930200Sbostic 	Handstart = COMP,	/* Player who starts hand		*/
6030200Sbostic 	Movetype,		/* Current move type			*/
6130200Sbostic 	Play,			/* Current player			*/
6230200Sbostic 	Numgos,			/* Number of Go cards used by computer	*/
6330200Sbostic 	Window = W_SMALL,	/* Current window wanted		*/
6430200Sbostic 	Numseen[NUM_CARDS],	/* Number of cards seen in current hand	*/
6530200Sbostic 	Value[NUM_MILES] = {	/* Value of mileage cards		*/
6630200Sbostic 		25, 50, 75, 100, 200
6730200Sbostic 	},
6830200Sbostic 	Numcards[NUM_CARDS] = {	/* Number of cards in deck		*/
6930200Sbostic 		10,	/* C_25 */
7030200Sbostic 		10,	/* C_50 */
7130200Sbostic 		10,	/* C_75 */
7230200Sbostic 		12,	/* C_100 */
7330200Sbostic 		4,	/* C_200 */
7430200Sbostic 		2,	/* C_EMPTY */
7530200Sbostic 		2,	/* C_FLAT */
7630200Sbostic 		2,	/* C_CRASH */
7730200Sbostic 		4,	/* C_STOP */
7830200Sbostic 		3,	/* C_LIMIT */
7930200Sbostic 		6,	/* C_GAS */
8030200Sbostic 		6,	/* C_SPARE */
8130200Sbostic 		6,	/* C_REPAIRS */
8230200Sbostic 		14,	/* C_GO */
8330200Sbostic 		6,	/* C_END_LIMIT */
8430200Sbostic 		1,	/* C_GAS_SAFE */
8530200Sbostic 		1,	/* C_SPARE_SAFE */
8630200Sbostic 		1,	/* C_DRIVE_SAFE */
8730200Sbostic 		1,	/* C_RIGHT_WAY */
8830200Sbostic 		0	/* C_INIT */
8930200Sbostic 	};
9030200Sbostic 	Numneed[NUM_CARDS] = {	/* number of cards needed per hand	*/
9130200Sbostic 		0,	/* C_25 */
9230200Sbostic 		0,	/* C_50 */
9330200Sbostic 		0,	/* C_75 */
9430200Sbostic 		0,	/* C_100 */
9530200Sbostic 		0,	/* C_200 */
9630200Sbostic 		2,	/* C_EMPTY */
9730200Sbostic 		2,	/* C_FLAT */
9830200Sbostic 		2,	/* C_CRASH */
9930200Sbostic 		4,	/* C_STOP */
10030200Sbostic 		3,	/* C_LIMIT */
10130200Sbostic 		2,	/* C_GAS */
10230200Sbostic 		2,	/* C_SPARE */
10330200Sbostic 		2,	/* C_REPAIRS */
10430200Sbostic 		10,	/* C_GO */
10530200Sbostic 		3,	/* C_END_LIMIT */
10630200Sbostic 		1,	/* C_GAS_SAFE */
10730200Sbostic 		1,	/* C_SPARE_SAFE */
10830200Sbostic 		1,	/* C_DRIVE_SAFE */
10930200Sbostic 		1,	/* C_RIGHT_WAY */
11030200Sbostic 		0	/* C_INIT */
11130200Sbostic 	};
11230200Sbostic 
11330200Sbostic CARD	Discard,		/* Top of discard pile			*/
11430200Sbostic 	Sh_discard,		/* Last discard card shown		*/
11530200Sbostic 	*Topcard,		/* Pointer to next card to be picked	*/
11630200Sbostic 	Opposite[NUM_CARDS] = {	/* Opposites of each card		*/
11730200Sbostic 		C_25, C_50, C_75, C_100, C_200, C_GAS, C_SPARE,
11830200Sbostic 		C_REPAIRS, C_GO, C_END_LIMIT, C_EMPTY, C_FLAT, C_CRASH,
11930200Sbostic 		C_STOP, C_LIMIT, C_EMPTY, C_FLAT, C_CRASH, C_STOP, C_INIT
12030200Sbostic 	},
12130200Sbostic 	Deck[DECK_SZ] = {	/* Current deck				*/
12230200Sbostic 		C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25,
12330200Sbostic 		C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50,
12430200Sbostic 		C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75,
12530200Sbostic 		C_100, C_100, C_100, C_100, C_100, C_100, C_100, C_100, C_100,
12630200Sbostic 		C_100, C_100, C_100,
12730200Sbostic 		C_200, C_200, C_200, C_200,
12830200Sbostic 		C_EMPTY, C_EMPTY,
12930200Sbostic 		C_FLAT, C_FLAT,
13030200Sbostic 		C_CRASH, C_CRASH,
13130200Sbostic 		C_STOP, C_STOP, C_STOP, C_STOP,
13230200Sbostic 		C_LIMIT, C_LIMIT, C_LIMIT,
13330200Sbostic 		C_GAS, C_GAS, C_GAS, C_GAS, C_GAS, C_GAS,
13430200Sbostic 		C_SPARE, C_SPARE, C_SPARE, C_SPARE, C_SPARE, C_SPARE,
13530200Sbostic 		C_REPAIRS, C_REPAIRS, C_REPAIRS, C_REPAIRS, C_REPAIRS,
13630200Sbostic 			C_REPAIRS,
13730200Sbostic 		C_END_LIMIT, C_END_LIMIT, C_END_LIMIT, C_END_LIMIT, C_END_LIMIT,
13830200Sbostic 			C_END_LIMIT,
13930200Sbostic 		C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO, C_GO,
14030200Sbostic 			C_GO, C_GO, C_GO, C_GO,
14130200Sbostic 		C_GAS_SAFE, C_SPARE_SAFE, C_DRIVE_SAFE, C_RIGHT_WAY
14230200Sbostic 	};
14330200Sbostic 
14430200Sbostic FILE	*outf;
14530200Sbostic 
14630200Sbostic PLAY	Player[2];		/* Player descriptions			*/
14730200Sbostic 
14830200Sbostic WINDOW	*Board,			/* Playing field screen			*/
14930200Sbostic 	*Miles,			/* Mileage screen			*/
15030200Sbostic 	*Score;			/* Score screen				*/
15130200Sbostic 
152