Use enums and defines for directions

This commit is contained in:
Pasi Kallinen
2021-06-27 15:31:00 +03:00
parent dad804e118
commit f25a6e26ee
15 changed files with 111 additions and 120 deletions

View File

@@ -16,9 +16,12 @@ NEARDATA long yn_number = 0L;
const char disclosure_options[] = "iavgco";
/* x/y/z deltas for the 10 movement directions (8 compass pts, 2 up/down) */
const schar xdir[10] = { -1, -1, 0, 1, 1, 1, 0, -1, 0, 0 };
const schar ydir[10] = { 0, -1, -1, -1, 0, 1, 1, 1, 0, 0 };
const schar zdir[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, -1 };
const schar xdir[N_DIRS_Z] = { -1, -1, 0, 1, 1, 1, 0, -1, 0, 0 };
const schar ydir[N_DIRS_Z] = { 0, -1, -1, -1, 0, 1, 1, 1, 0, 0 };
const schar zdir[N_DIRS_Z] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, -1 };
/* redordered directions, cardinals first */
const schar dirs_ord[N_DIRS] =
{ DIR_W, DIR_N, DIR_E, DIR_S, DIR_NW, DIR_NE, DIR_SE, DIR_SW };
NEARDATA struct flag flags;
NEARDATA boolean has_strong_rngseed = FALSE;