1: # include   <ctype.h>
   2: # include   "curses.h"
   3: 
   4: /*
   5:  * @(#)mille.h	1.1 (Berkeley) 4/1/82
   6:  */
   7: 
   8: /*
   9:  * Miscellaneous constants
  10:  */
  11: 
  12: # define    unsgn       unsigned
  13: # define    CARD        short
  14: 
  15: # define    ARNOLD      214 /* my uid			*/
  16: 
  17: # define    GURP        28672   /* bad uid			*/
  18: # define    MAXUSERS    35  /* max # of users for startup	*/
  19: # define    HAND_SZ     7   /* number of cards in a hand	*/
  20: # define    DECK_SZ     101 /* number of cards in decks	*/
  21: # define    NUM_SAFE    4   /* number of saftey cards	*/
  22: # define    NUM_MILES   5   /* number of milestones types	*/
  23: # define    NUM_CARDS   20  /* number of types of cards	*/
  24: # define    BOARD_Y     17  /* size of board screen		*/
  25: # define    BOARD_X     40
  26: # define    MILES_Y     7   /* size of mileage screen	*/
  27: # define    MILES_X     80
  28: # define    SCORE_Y     17  /* size of score screen		*/
  29: # define    SCORE_X     40
  30: # define    MOVE_Y      10  /* Where to print move prompt	*/
  31: # define    MOVE_X      20
  32: # define    ERR_Y       15  /* Where to print errors	*/
  33: # define    ERR_X       5
  34: # define    EXT_Y       4   /* Where to put Extension	*/
  35: # define    EXT_X       9
  36: 
  37: # define    PLAYER      0
  38: # define    COMP        1
  39: 
  40: # define    W_SMALL     0   /* Small (initial) window	*/
  41: # define    W_FULL      1   /* Full (final) window		*/
  42: 
  43: /*
  44:  * Move types
  45:  */
  46: 
  47: # define    M_DISCARD   0
  48: # define    M_DRAW      1
  49: # define    M_PLAY      2
  50: # define    M_ORDER     3
  51: 
  52: /*
  53:  * Scores
  54:  */
  55: 
  56: # define    SC_SAFETY   100
  57: # define    SC_ALL_SAFE 300
  58: # define    SC_COUP     300
  59: # define    SC_TRIP     400
  60: # define    SC_SAFE     300
  61: # define    SC_DELAY    300
  62: # define    SC_EXTENSION    200
  63: # define    SC_SHUT_OUT 500
  64: 
  65: /*
  66:  * safety descriptions
  67:  */
  68: 
  69: # define    S_UNKNOWN   0   /* location of safety unknown	*/
  70: # define    S_IN_HAND   1   /* safety in player's hand	*/
  71: # define    S_PLAYED    2   /* safety has been played	*/
  72: # define    S_GAS_SAFE  0   /* Gas safety card index	*/
  73: # define    S_SPARE_SAFE    1   /* Tire safety card index	*/
  74: # define    S_DRIVE_SAFE    2   /* Driveing safety card index	*/
  75: # define    S_RIGHT_WAY 3   /* Right-of-Way card index	*/
  76: # define    S_CONV      15  /* conversion from C_ to S_	*/
  77: 
  78: /*
  79:  * card numbers
  80:  */
  81: 
  82: # define    C_INIT      -1
  83: # define    C_25        0
  84: # define    C_50        1
  85: # define    C_75        2
  86: # define    C_100       3
  87: # define    C_200       4
  88: # define    C_EMPTY     5
  89: # define    C_FLAT      6
  90: # define    C_CRASH     7
  91: # define    C_STOP      8
  92: # define    C_LIMIT     9
  93: # define    C_GAS       10
  94: # define    C_SPARE     11
  95: # define    C_REPAIRS   12
  96: # define    C_GO        13
  97: # define    C_END_LIMIT 14
  98: # define    C_GAS_SAFE  15
  99: # define    C_SPARE_SAFE    16
 100: # define    C_DRIVE_SAFE    17
 101: # define    C_RIGHT_WAY 18
 102: 
 103: /*
 104:  * prompt types
 105:  */
 106: 
 107: # define    MOVEPROMPT      0
 108: # define    REALLYPROMPT        1
 109: # define    ANOTHERHANDPROMPT   2
 110: # define    ANOTHERGAMEPROMPT   3
 111: # define    SAVEGAMEPROMPT      4
 112: # define    SAMEFILEPROMPT      5
 113: # define    FILEPROMPT      6
 114: # define    EXTENSIONPROMPT     7
 115: # define    OVERWRITEFILEPROMPT 8
 116: 
 117: # ifdef SYSV
 118: # define    srandom(x)  srand(x)
 119: # define    random()    rand()
 120: 
 121: # ifndef    attron
 122: #	define    erasechar() _tty.c_cc[VERASE]
 123: #	define    killchar()  _tty.c_cc[VKILL]
 124: # endif
 125: # else
 126: # ifndef    erasechar
 127: #	define    erasechar() _tty.sg_erase
 128: #	define    killchar()  _tty.sg_kill
 129: # endif
 130: # endif	SYSV
 131: 
 132: typedef struct {
 133:     bool    coups[NUM_SAFE];
 134:     bool    can_go;
 135:     bool    new_battle;
 136:     bool    new_speed;
 137:     short   safety[NUM_SAFE];
 138:     short   sh_safety[NUM_SAFE];
 139:     short   nummiles[NUM_MILES];
 140:     short   sh_nummiles[NUM_MILES];
 141:     CARD    hand[HAND_SZ];
 142:     CARD    sh_hand[HAND_SZ];
 143:     CARD    battle;
 144:     CARD    sh_battle;
 145:     CARD    speed;
 146:     CARD    sh_speed;
 147:     int mileage;
 148:     int sh_mileage;
 149:     int hand_tot;
 150:     int sh_hand_tot;
 151:     int safescore;
 152:     int sh_safescore;
 153:     int coupscore;
 154:     int total;
 155:     int sh_total;
 156:     int games;
 157:     int sh_games;
 158:     int was_finished;
 159: } PLAY;
 160: 
 161: /*
 162:  * macros
 163:  */
 164: 
 165: # define    other(x)    (1 - x)
 166: # define    nextplay()  (Play = other(Play))
 167: # define    nextwin(x)  (1 - x)
 168: # define    opposite(x) (Opposite[x])
 169: # define    issafety(x) (x >= C_GAS_SAFE)
 170: 
 171: /*
 172:  * externals
 173:  */
 174: 
 175: extern bool Debug, Finished, Next, On_exit, Order, Saved;
 176: 
 177: extern char *C_fmt, **C_name, *Fromfile, Initstr[];
 178: 
 179: extern int  Card_no, End, Handstart, Movetype, Numcards[], Numgos,
 180:         Numneed[], Numseen[NUM_CARDS], Play, Value[], Window;
 181: 
 182: extern CARD Deck[DECK_SZ], Discard, Opposite[NUM_CARDS], Sh_discard,
 183:         *Topcard;
 184: 
 185: extern FILE *outf;
 186: 
 187: extern PLAY Player[2];
 188: 
 189: extern WINDOW   *Board, *Miles, *Score;
 190: 
 191: /*
 192:  * functions
 193:  */
 194: 
 195: CARD    getcard();

Defined macros

ANOTHERGAMEPROMPT defined in line 110; used 1 times
ANOTHERHANDPROMPT defined in line 109; used 1 times
ARNOLD defined in line 15; used 1 times
BOARD_X defined in line 25; used 1 times
BOARD_Y defined in line 24; used 1 times
C_100 defined in line 86; used 14 times
C_25 defined in line 83; used 17 times
C_50 defined in line 84; used 17 times
C_75 defined in line 85; used 12 times
C_CRASH defined in line 90; used 4 times
C_DRIVE_SAFE defined in line 100; used 2 times
C_EMPTY defined in line 88; used 4 times
C_FLAT defined in line 89; used 4 times
C_GAS defined in line 93; used 8 times
C_GAS_SAFE defined in line 98; used 3 times
C_GO defined in line 96; used 26 times
C_LIMIT defined in line 92; used 31 times
C_REPAIRS defined in line 95; used 8 times
C_SPARE defined in line 94; used 8 times
C_SPARE_SAFE defined in line 99; used 2 times
C_STOP defined in line 91; used 11 times
EXTENSIONPROMPT defined in line 114; used 1 times
EXT_X defined in line 35; used 1 times
EXT_Y defined in line 34; used 1 times
FILEPROMPT defined in line 113; used 2 times
GURP defined in line 17; never used
MAXUSERS defined in line 18; never used
MILES_X defined in line 27; used 1 times
MILES_Y defined in line 26; used 1 times
MOVEPROMPT defined in line 107; used 3 times
MOVE_X defined in line 31; used 7 times
MOVE_Y defined in line 30; used 7 times
M_DISCARD defined in line 47; used 2 times
M_DRAW defined in line 48; used 5 times
M_ORDER defined in line 50; used 1 times
M_PLAY defined in line 49; used 4 times
NUM_CARDS defined in line 23; used 10 times
NUM_MILES defined in line 22; used 5 times
OVERWRITEFILEPROMPT defined in line 115; used 1 times
REALLYPROMPT defined in line 108; used 1 times
SAMEFILEPROMPT defined in line 112; used 1 times
SAVEGAMEPROMPT defined in line 111; used 1 times
SCORE_X defined in line 29; used 1 times
SCORE_Y defined in line 28; used 3 times
SC_ALL_SAFE defined in line 57; used 3 times
SC_COUP defined in line 58; used 4 times
SC_DELAY defined in line 61; used 2 times
SC_EXTENSION defined in line 62; used 1 times
SC_SAFE defined in line 60; used 3 times
SC_SAFETY defined in line 56; used 4 times
SC_SHUT_OUT defined in line 63; used 2 times
SC_TRIP defined in line 59; used 4 times
S_DRIVE_SAFE defined in line 74; never used
S_GAS_SAFE defined in line 72; never used
S_IN_HAND defined in line 70; used 2 times
S_RIGHT_WAY defined in line 75; used 16 times
S_SPARE_SAFE defined in line 73; never used
W_SMALL defined in line 40; used 2 times
erasechar defined in line 127; used 1 times
killchar defined in line 128; never used
nextplay defined in line 166; used 1 times
nextwin defined in line 167; used 1 times
other defined in line 165; used 7 times
random defined in line 119; used 2 times
srandom defined in line 118; used 2 times
unsgn defined in line 12; used 1 times

Usage of this include

Last modified: 1986-01-11
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 4418
Valid CSS Valid XHTML 1.0 Strict