1 /* 2 * @(#) trojplpl.h -- Header file for TROJKA 3 * created: 4.iii.1992 4 * last update: 25.ii.1994 5 */ 6 7 #ifndef _trojka_h_ 8 #define _trojka_h 9 10 #ifndef TRUE 11 #define TRUE 1 12 #endif 13 #ifndef FALSE 14 #define FALSE 0 15 #endif 16 17 typedef unsigned char flag; 18 19 /* 20 * virtual-field defines 21 */ 22 23 /* layout of the virtual matrix 24 ______________ 25 21 |__|__|__|__|__|<-------- buffer space for scanning, 26 20 PLM_TOP |__|__|__|__|__|<--. contents are always 0 27 19 | | | | | | \ 28 18 | | \ actual PLaying Matrix, where the 29 .. : : > on-screen visible blocks are stored 30 2 |__|__|__|__|__| / 31 1 PLM_BOTTOM |__|__|__|__|__|<---' 32 0 |__|__|__|__|__|<-------- buffer space for bottom, 33 0 1 2 3 4 contents are always != 0 34 ^_ _ _ _ _ _ VIRT_MIDDLE 35 36 */ 37 38 #define VIRT_XSIZE 5 /* dimensions of virtual field-array */ 39 #define VIRT_YSIZE 22 40 #define VIRT_MIDDLE 2 /* middle of virtual field */ 41 #define PLM_TOP 20 /* constants for PLaying Matrix, */ 42 #define PLM_BOTTOM 1 /* see explanation above */ 43 44 45 #define CLEAR 0 /* empty space for fieldarray */ 46 #define TAGGED -1 /* tagged field element, ready to be wiped */ 47 48 /* 49 * end of virtual field defines 50 */ 51 52 #define X_MIN 32 /* oriented on 1..80x1..25 screen !!!! */ 53 #define X_MAX 48 54 #define STATX (X_MAX + 12) 55 56 /* 57 * general 58 */ 59 60 #define BLOCKS 5 61 #define MAXSPEED 9 62 #define MESGS 19 /* number of cookies */ 63 #define MAX_MESG_TIME 10 64 #define MESG_SWITCH 10000 65 #define SPEED_SWITCH 100 66 #define TROJKA 3 /* ..it's the magic number (yes, it is) */ 67 68 69 /* 70 * game-control-keys 71 */ 72 73 74 #define LF 0x0a /* line feed */ 75 #define CR 0x0d /* carriage return */ 76 #define BACKSP '\b' /* back space */ 77 #define SPACE ' ' /* SPACE*/ 78 #define QUIT 'q' 79 #define REDRAW 12 /* redraw screen */ 80 81 #define LEFT '4' 82 #define RIGHT '6' 83 #define DROP '2' 84 #define SPEEDUP '7' 85 #define INSDROP '0' 86 87 /* vi - compatibility */ 88 89 #define VIRIGHT 'l' 90 #define VILEFT 'h' 91 #define VIDROP 'j' 92 #define VISPEEDUP 'k' 93 94 95 96 #define qprintf printw 97 #define movexy(x, y) move((y)-1, (x)-1) 98 #define getrandom(s) (rand() % (s)) 99 #define setrandom() srand((unsigned)time(0)) 100 #define clear_scr() clear();refresh() 101 #define clreol() clrtoeol() 102 103 104 105 #endif _trojka_h_ 106