// maze constants and datatypes // // R. Perry, March 1991; updated Nov 2006, Jan 2016, Apr 2023 // extern int debug, solve; /* left, down wall values */ #define OPEN 0 #define CLOSED 1 /* cell types */ #define SPANTREE 0 #define FRONTIER 1 #define NEITHER 2 /* solution path flags */ #define OFF 0 #define ON 1 /* 001 */ #define LEFT 2 /* 010 */ #define DOWN 4 /* 100 */ struct cell { unsigned int left:1, down:1, type:2; unsigned int path:3; /* solution path flag */ }; /* frontier stack cell */ struct frontier { int row, col; }; typedef void (*Maze_fn)( struct cell **maze, int m, int n); int irand( int n); void shuffle( int a[], int n); struct cell **maze_alloc( int m, int n); void maze_init( struct cell **maze, int m, int n); int maze_read( struct cell **maze, int m, int n); void maze_print_raw( struct cell **maze, int m, int n); void maze_print_X( struct cell **maze, int m, int n);