Annotation of 42BSD/games/mille/mille.h, revision 1.1

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.