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 the above copyright notice and this paragraph are 7 * duplicated in all such forms and that any documentation, 8 * advertising materials, and other materials related to such 9 * distribution and use acknowledge that the software was developed 10 * by the University of California, Berkeley. The name of the 11 * University may not be used to endorse or promote products derived 12 * from this software without specific prior written permission. 13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16 * 17 * @(#)robots.h 5.4 (Berkeley) 05/02/90 18 */ 19 20 # include <curses.h> 21 # include <setjmp.h> 22 23 /* 24 * miscellaneous constants 25 */ 26 27 # define Y_FIELDSIZE 23 28 # define X_FIELDSIZE 60 29 # define Y_SIZE 24 30 # define X_SIZE 80 31 # define MAXLEVELS 4 32 # define MAXROBOTS (MAXLEVELS * 10) 33 # define ROB_SCORE 10 34 # define S_BONUS (60 * ROB_SCORE) 35 # define Y_SCORE 21 36 # define X_SCORE (X_FIELDSIZE + 9) 37 # define Y_PROMPT (Y_FIELDSIZE - 1) 38 # define X_PROMPT (X_FIELDSIZE + 2) 39 # define MAXSCORES (Y_SIZE - 2) 40 # define MAXNAME 16 41 # define MS_NAME "Ten" 42 43 /* 44 * characters on screen 45 */ 46 47 # define ROBOT '+' 48 # define HEAP '*' 49 # define PLAYER '@' 50 51 /* 52 * pseudo functions 53 */ 54 55 # undef CTRL 56 # define CTRL(X) ('X' - 'A' + 1) 57 58 /* 59 * type definitions 60 */ 61 62 typedef struct { 63 int y, x; 64 } COORD; 65 66 /* 67 * global variables 68 */ 69 70 extern bool Dead, Full_clear, Jump, Newscore, Real_time, Running, 71 Teleport, Waiting, Was_bonus; 72 73 #ifdef FANCY 74 extern bool Pattern_roll, Stand_still; 75 #endif 76 77 extern char Cnt_move, Field[Y_FIELDSIZE][X_FIELDSIZE], *Next_move, 78 *Move_list, Run_ch; 79 80 extern int Count, Level, Num_robots, Num_scores, Score, 81 Start_level, Wait_bonus; 82 83 extern COORD Max, Min, My_pos, Robots[]; 84 85 extern jmp_buf End_move; 86 87 /* 88 * functions types 89 */ 90 91 int quit(), cmp_sc(), move_robots(); 92 93 COORD *rnd_pos(); 94