xref: /original-bsd/games/atc/def.h (revision e1db577d)
1 /*-
2  * Copyright (c) 1990 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Ed James.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)def.h	5.2 (Berkeley) 04/30/90
11  */
12 
13 /*
14  * Copyright (c) 1987 by Ed James, UC Berkeley.  All rights reserved.
15  *
16  * Copy permission is hereby granted provided that this notice is
17  * retained on all partial or complete copies.
18  *
19  * For more info on this and all of my stuff, mail edjames@berkeley.edu.
20  */
21 
22 #define AUTHOR_STR		"ATC - by Ed James"
23 
24 #define PI			3.14159654
25 
26 #define LOWFUEL			15
27 
28 #define REALLOC			10
29 
30 #define SGN(x)			((x < 0) ? -1 : ((x > 0) ? 1 : 0))
31 #define ABS(x)			((x < 0) ? -(x) : (x))
32 #define DIR_FROM_DXDY(dx,dy)	((int) (atan2((double)(dy), (double)(dx)) \
33 				* MAXDIR / (2 * PI) + 2.5 + MAXDIR) % MAXDIR)
34 
35 #define MAXDIR		8
36 
37 #define D_LEFT		1
38 #define D_RIGHT		2
39 #define D_UP		3
40 #define D_DOWN		4
41 
42 #define T_NODEST	0
43 #define T_BEACON	1
44 #define T_EXIT		2
45 #define T_AIRPORT	3
46 
47 #define S_NONE		0
48 #define S_GONE		1
49 #define S_MARKED	2
50 #define S_UNMARKED	3
51 #define S_IGNORED	4
52 
53 #define INPUT_LINES	3
54 #define PLANE_COLS	20
55