X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=sst.h;h=203a1690473f8b777861e89c5da8a7ca7ea3297c;hb=bdcf85461c171a9263fb0ba0e0ec07661bd082f5;hp=9a67c1d063ac1dd44cafcb6a6d15c34ff7edc51c;hpb=e536fe754b3a9be00dcaee8f6ec50ea2d8c7a184;p=super-star-trek.git diff --git a/sst.h b/sst.h index 9a67c1d..203a169 100644 --- a/sst.h +++ b/sst.h @@ -21,6 +21,15 @@ #define QUADSIZE (10) #define BASEMAX (6) +/* + * These macros hide the difference between 0-origin and 1-origin addressing. + * They're a step towards de-FORTRANizing the code. + */ +#define VALID_QUADRANT(x, y) ((x)>=1 && (x)<=GALSIZE && (y)>=1 && (y)<=GALSIZE) +#define VALID_SECTOR(x, y) ((x)>=1 && (x)<=QUADSIZE && (y)>=1 && (y)<=QUADSIZE) +#define for_quadrants(i) for (i = 1; i < GALSIZE+1; i++) +#define for_sectors(i) for (i = 1; i < QUADSIZE+1; i++) + typedef struct { int x; /* Quadrant location of planet */ int y; @@ -212,7 +221,8 @@ EXTERN struct { probex, probey, probeinx, - probeiny; + probeiny, + height; } game; #define inkling game.inkling // Initial number of klingons