xref: /original-bsd/games/robots/robots.h (revision 5133e8a4)
1 /*
2  * Copyright (c) 1980 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)robots.h	5.6 (Berkeley) 02/28/91
8  */
9 
10 # include	<curses.h>
11 # include	<setjmp.h>
12 
13 /*
14  * miscellaneous constants
15  */
16 
17 # define	Y_FIELDSIZE	23
18 # define	X_FIELDSIZE	60
19 # define	Y_SIZE		24
20 # define	X_SIZE		80
21 # define	MAXLEVELS	4
22 # define	MAXROBOTS	(MAXLEVELS * 10)
23 # define	ROB_SCORE	10
24 # define	S_BONUS		(60 * ROB_SCORE)
25 # define	Y_SCORE		21
26 # define	X_SCORE		(X_FIELDSIZE + 9)
27 # define	Y_PROMPT	(Y_FIELDSIZE - 1)
28 # define	X_PROMPT	(X_FIELDSIZE + 2)
29 # define	MAXSCORES	(Y_SIZE - 2)
30 # define	MAXNAME		16
31 # define	MS_NAME		"Ten"
32 
33 /*
34  * characters on screen
35  */
36 
37 # define	ROBOT	'+'
38 # define	HEAP	'*'
39 # define	PLAYER	'@'
40 
41 /*
42  * pseudo functions
43  */
44 
45 # undef		CTRL
46 # define	CTRL(X)	('X' - 'A' + 1)
47 
48 /*
49  * type definitions
50  */
51 
52 typedef struct {
53 	int	y, x;
54 } COORD;
55 
56 /*
57  * global variables
58  */
59 
60 extern bool	Dead, Full_clear, Jump, Newscore, Real_time, Running,
61 		Teleport, Waiting, Was_bonus;
62 
63 #ifdef	FANCY
64 extern bool	Pattern_roll, Stand_still;
65 #endif
66 
67 extern char	Cnt_move, Field[Y_FIELDSIZE][X_FIELDSIZE], *Next_move,
68 		*Move_list, Run_ch;
69 
70 extern int	Count, Level, Num_robots, Num_scores, Score,
71 		Start_level, Wait_bonus;
72 
73 extern COORD	Max, Min, My_pos, Robots[];
74 
75 extern jmp_buf	End_move;
76 
77 /*
78  * functions types
79  */
80 
81 int	cmp_sc();
82 void	move_robots();
83 
84 COORD	*rnd_pos();
85