|
|
1.1 ! root 1: /* @(#)mille.h 4.1 12/24/82 */ ! 2: ! 3: # include <ctype.h> ! 4: # include <curses.h> ! 5: ! 6: /* ! 7: * Miscellaneous constants ! 8: */ ! 9: ! 10: # define unsgn unsigned ! 11: # define CARD short ! 12: ! 13: # ifdef vax ! 14: # define ARNOLD 78 /* my uid */ ! 15: # else ! 16: # define ARNOLD 24601 /* my uid */ ! 17: # endif ! 18: ! 19: # define GURP 28672 /* bad uid */ ! 20: # define MAXUSERS 35 /* max # of users for startup */ ! 21: # define HAND_SZ 7 /* number of cards in a hand */ ! 22: # define DECK_SZ 101 /* number of cards in decks */ ! 23: # define NUM_SAFE 4 /* number of saftey cards */ ! 24: # define NUM_MILES 5 /* number of milestones types */ ! 25: # define NUM_CARDS 20 /* number of types of cards */ ! 26: # define BOARD_Y 17 /* size of board screen */ ! 27: # define BOARD_X 40 ! 28: # define MILES_Y 7 /* size of mileage screen */ ! 29: # define MILES_X 80 ! 30: # define SCORE_Y 17 /* size of score screen */ ! 31: # define SCORE_X 40 ! 32: # define MOVE_Y 10 /* Where to print move prompt */ ! 33: # define MOVE_X 20 ! 34: # define ERR_Y 15 /* Where to print errors */ ! 35: # define ERR_X 5 ! 36: # define EXT_Y 4 /* Where to put Extension */ ! 37: # define EXT_X 9 ! 38: ! 39: # define PLAYER 0 ! 40: # define COMP 1 ! 41: ! 42: # define W_SMALL 0 /* Small (initial) window */ ! 43: # define W_FULL 1 /* Full (final) window */ ! 44: ! 45: /* ! 46: * Move types ! 47: */ ! 48: ! 49: # define M_DISCARD 0 ! 50: # define M_DRAW 1 ! 51: # define M_PLAY 2 ! 52: # define M_ORDER 3 ! 53: ! 54: /* ! 55: * Scores ! 56: */ ! 57: ! 58: # define SC_SAFETY 100 ! 59: # define SC_ALL_SAFE 300 ! 60: # define SC_COUP 300 ! 61: # define SC_TRIP 400 ! 62: # define SC_SAFE 300 ! 63: # define SC_DELAY 300 ! 64: # define SC_EXTENSION 200 ! 65: # define SC_SHUT_OUT 500 ! 66: ! 67: /* ! 68: * safety descriptions ! 69: */ ! 70: ! 71: # define S_UNKNOWN 0 /* location of safety unknown */ ! 72: # define S_IN_HAND 1 /* safety in player's hand */ ! 73: # define S_PLAYED 2 /* safety has been played */ ! 74: # define S_GAS_SAFE 0 /* Gas safety card index */ ! 75: # define S_SPARE_SAFE 1 /* Tire safety card index */ ! 76: # define S_DRIVE_SAFE 2 /* Driveing safety card index */ ! 77: # define S_RIGHT_WAY 3 /* Right-of-Way card index */ ! 78: # define S_CONV 15 /* conversion from C_ to S_ */ ! 79: ! 80: /* ! 81: * card numbers ! 82: */ ! 83: ! 84: # define C_INIT -1 ! 85: # define C_25 0 ! 86: # define C_50 1 ! 87: # define C_75 2 ! 88: # define C_100 3 ! 89: # define C_200 4 ! 90: # define C_EMPTY 5 ! 91: # define C_FLAT 6 ! 92: # define C_CRASH 7 ! 93: # define C_STOP 8 ! 94: # define C_LIMIT 9 ! 95: # define C_GAS 10 ! 96: # define C_SPARE 11 ! 97: # define C_REPAIRS 12 ! 98: # define C_GO 13 ! 99: # define C_END_LIMIT 14 ! 100: # define C_GAS_SAFE 15 ! 101: # define C_SPARE_SAFE 16 ! 102: # define C_DRIVE_SAFE 17 ! 103: # define C_RIGHT_WAY 18 ! 104: ! 105: typedef struct { ! 106: bool coups[NUM_SAFE]; ! 107: bool can_go; ! 108: bool new_battle; ! 109: bool new_speed; ! 110: short safety[NUM_SAFE]; ! 111: short nummiles[NUM_MILES]; ! 112: CARD hand[HAND_SZ]; ! 113: CARD battle; ! 114: CARD speed; ! 115: int mileage; ! 116: int hand_tot; ! 117: int safescore; ! 118: int coupscore; ! 119: int total; ! 120: int games; ! 121: } PLAY; ! 122: ! 123: /* ! 124: * macros ! 125: */ ! 126: ! 127: # define other(x) (1 - x) ! 128: # define nextplay() (Play = other(Play)) ! 129: # define nextwin(x) (1 - x) ! 130: # define opposite(x) (Opposite[x]) ! 131: # define issafety(x) (x >= C_GAS_SAFE) ! 132: ! 133: /* ! 134: * externals ! 135: */ ! 136: ! 137: extern bool Debug, Finished, Next, On_exit, Order, Saved; ! 138: ! 139: extern char *C_fmt, **C_name, *Fromfile, Initstr[]; ! 140: ! 141: extern int Card_no, End, Handstart, Movetype, Numcards[], Numgos, ! 142: Numneed[], Numseen[NUM_CARDS], Play, Value[], Window; ! 143: ! 144: extern CARD Deck[DECK_SZ], Discard, Opposite[NUM_CARDS], *Topcard; ! 145: ! 146: extern FILE *outf; ! 147: ! 148: extern PLAY Player[2]; ! 149: ! 150: extern WINDOW *Board, *Miles, *Score; ! 151: ! 152: /* ! 153: * functions ! 154: */ ! 155: ! 156: CARD getcard();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.