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