1 /* 2 * Copyright (c) 1980 Regents of the University of California. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms are permitted 6 * provided that this notice is preserved and that due credit is given 7 * to the University of California at Berkeley. The name of the University 8 * may not be used to endorse or promote products derived from this 9 * software without specific prior written permission. This software 10 * is provided ``as is'' without express or implied warranty. 11 * 12 * @(#)robots.h 5.2 (Berkeley) 03/09/88 13 */ 14 15 # include <curses.h> 16 # include <setjmp.h> 17 18 /* 19 * miscellaneous constants 20 */ 21 22 # define Y_FIELDSIZE 23 23 # define X_FIELDSIZE 60 24 # define Y_SIZE 24 25 # define X_SIZE 80 26 # define MAXLEVELS 4 27 # define MAXROBOTS (MAXLEVELS * 10) 28 # define ROB_SCORE 10 29 # define S_BONUS (60 * ROB_SCORE) 30 # define Y_SCORE 21 31 # define X_SCORE (X_FIELDSIZE + 9) 32 # define Y_PROMPT (Y_FIELDSIZE - 1) 33 # define X_PROMPT (X_FIELDSIZE + 2) 34 # define MAXSCORES (Y_SIZE - 2) 35 # define MAXNAME 16 36 # define MS_NAME "Ten" 37 # define SCOREFILE "/usr/games/lib/robots_roll" 38 39 /* 40 * characters on screen 41 */ 42 43 # define ROBOT '+' 44 # define HEAP '*' 45 # define PLAYER '@' 46 47 /* 48 * pseudo functions 49 */ 50 51 # undef CTRL 52 # define CTRL(X) ('X' - 'A' + 1) 53 54 /* 55 * type definitions 56 */ 57 58 typedef struct { 59 int y, x; 60 } COORD; 61 62 /* 63 * global variables 64 */ 65 66 extern bool Dead, Full_clear, Jump, Newscore, Real_time, Running, 67 Teleport, Waiting, Was_bonus; 68 69 #ifdef FANCY 70 extern bool Pattern_roll, Stand_still; 71 #endif 72 73 extern char Cnt_move, Field[Y_FIELDSIZE][X_FIELDSIZE], *Next_move, 74 *Move_list, Run_ch; 75 76 extern int Count, Level, Num_robots, Num_scores, Score, 77 Start_level, Wait_bonus; 78 79 extern COORD Max, Min, My_pos, Robots[]; 80 81 extern jmp_buf End_move; 82 83 /* 84 * functions types 85 */ 86 87 int quit(), cmp_sc(), move_robots(); 88 89 COORD *rnd_pos(); 90