Annotation of researchv9/jtools/src/demo/pacman/board.c, revision 1.1.1.1

1.1       root        1: /*----------------------------------------------------------------------*/
                      2: /*                                                                     */
                      3: /*     PACMAN for BBN BitGraphs                                        */
                      4: /*                                                                     */
                      5: /*               File: board.c68                                       */
                      6: /*           Contents: declaration of game board and operations        */
                      7: /*             Author: Bob Brown (rlb)                                 */
                      8: /*                     Purdue CS                                       */
                      9: /*               Date: May, 1982                                       */
                     10: /*        Description: The Game board is not easily changed.  The      */
                     11: /*                     characters used are also defined in pacman.h    */
                     12: /*                                                                     */
                     13: /*----------------------------------------------------------------------*/
                     14: 
                     15: #include "style.h"
                     16: #include "pacman.h"
                     17: 
                     18: /*
                     19: ** Due to memory limitations, the static game board shown below is
                     20: ** overwritten by the dynamic version.  
                     21: */
                     22: 
                     23: bool   Blasted = FALSE;
                     24: 
                     25: char *Board[] = {
                     26:        "2000000000000320000000000003",
                     27:        "1777777777777117777777777771",
                     28:        "1720037200037117200037200371",
                     29:        "1819917199917117199917199181",
                     30:        "1750047500047547500047500471",
                     31:        "1777777777777777777777777771",
                     32:        "1720037237200000037237200371",
                     33:        "1750047117500320047117500471",
                     34:        "1777777117777117777117777771",
                     35:        "5000037150039119200417200004",
                     36:        "999991712004=54=500317199999",
                     37:        "999991711;;;;;;;;;;117199999",
                     38:        "999991711;20666603;117199999",
                     39:        "000004754;19999991;547500000",
                     40:        "::::::799;19999991;997::::::",
                     41:        "000003723;19999991;237200000",
                     42:        "999991711;50000004;117199999",
                     43:        "999991711;;;;;;;;;;117199999",
                     44:        "9999917119200000039117199999",
                     45:        "2000047549500320049547500003",
                     46:        "1777777777777117777777777771",
                     47:        "1720037200037117200037200371",
                     48:        "175031750004<54<500047120471",
                     49:        "1877117777777997777777117781",
                     50:        "5037117237200000037237117204",
                     51:        "2047547117500320047117547503",
                     52:        "1777777117777117777117777771",
                     53:        "1720000450037117200450000371",
                     54:        "1750000000047547500000000471",
                     55:        "1777777777777777777777777771",
                     56:        "5000000000000000000000000004",
                     57: };
                     58: 
                     59: /*
                     60: ** Generate a new board from the fixed board
                     61: */
                     62: newboard()
                     63: {
                     64:        register int i,j;
                     65:        register char c;
                     66:        for ( i=0 ; i<MAZEROWS ; i++ )
                     67:                for ( j=0 ; j<MAZECOLS ; j++ ) {
                     68:                        Board[i][j] &= TYPEMASK;
                     69:                        switch ( Board[i][j] ) {
                     70:                        case FIXPILL:
                     71:                                Board[i][j] |= PILL;
                     72:                                break;
                     73:                        case BLKDOT:
                     74:                        case FIXGOLD:
                     75:                                Board[i][j] |= GOLD;
                     76:                        }
                     77:                }
                     78: }
                     79: char chrmap[] = {"abcdefghi   h "};
                     80: drawboard()
                     81: {
                     82:        register int i,j;
                     83:        register char c;
                     84:        /*cursinhibit();*/
                     85:        for ( i=0 ; i<MAZEROWS ; i++ ) {
                     86:                for ( j=0 ; j<MAZECOLS ; j++ ) {
                     87:                        c = chrmap[Board[i][j] & TYPEMASK];
                     88:                        if ( c!=' ' )
                     89:                                blt24(c,MZtoSC(i),MZtoSC(j),REPLACE);
                     90:                }
                     91: #ifndef BLIT
                     92:                rsetdead();
                     93: #endif
                     94:        }
                     95:        /*cursallow();*/
                     96: }

unix.superglobalmegacorp.com

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