28 February 2023 8:46:26.280 AM maze_test(): FORTRAN90 version maze() implements some maze algorithms. maze_diameter_test(): maze_diameter(): find two far apart cells; Cell numbers for the maze: 1 9 17 25 33 41 49 57 65 73 2 10 18 26 34 42 50 58 66 74 3 11 19 27 35 43 51 59 67 75 4 12 20 28 36 44 52 60 68 76 5 13 21 29 37 45 53 61 69 77 6 14 22 30 38 46 54 62 70 78 7 15 23 31 39 47 55 63 71 79 8 16 24 32 40 48 56 64 72 80 A random maze: Number of rows = 8 Number of columns = 10 The maze: +--+--+--+--+--+--+--+--+--+--+ | | | | +--+ + +--+--+--+--+--+--+ + | | | | | | | | | + + + + +--+ + + +--+ + | | | | | + + +--+ + + +--+ +--+ + | | | | | + +--+ + + + + + +--+ + | | | | | | | | | + +--+ + +--+ + +--+ + + | | | | | | | | + + +--+--+ + + +--+ +--+ | | | | | | | + + +--+ + +--+ + +--+ + | | | | | | | | +--+--+--+--+--+--+--+--+--+--+ Rooted tree representation: (0 is the root. All other cells print the cell number of their parent on the tree.) 9 10 18 17 25 33 41 49 57 74 3 11 19 27 26 43 51 59 58 75 4 12 11 28 27 35 43 51 75 76 12 20 28 0 35 43 60 59 60 68 4 5 20 28 36 44 52 60 61 76 5 6 21 29 30 45 53 54 69 77 6 14 15 23 38 46 54 55 70 71 7 15 32 31 39 56 55 63 80 79 Random maze with far apart ends: Diameter = 27 Starting cell = 8 9 Stopping cell = 1 9 The maze: +--+--+--+--+--+--+--+--+--+--+ | | $$| | +--+ + +--+--+--+--+--+--+ + | | | | | | | | | + + + + +--+ + + +--+ + | | | | | + + +--+ + + +--+ +--+ + | | | | | + +--+ + + + + + +--+ + | | | | | | | | | + +--+ + +--+ + +--+ + + | | | | | | | | + + +--+--+ + + +--+ +--+ | | | | | | | + + +--+ + +--+ + +--+ + | | | | | | |00 | +--+--+--+--+--+--+--+--+--+--+ maze_path_test(): maze_path() generates a path from one cell to another, in a connected maze. Cell numbers for the maze: 1 9 17 25 33 41 49 57 65 73 2 10 18 26 34 42 50 58 66 74 3 11 19 27 35 43 51 59 67 75 4 12 20 28 36 44 52 60 68 76 5 13 21 29 37 45 53 61 69 77 6 14 22 30 38 46 54 62 70 78 7 15 23 31 39 47 55 63 71 79 8 16 24 32 40 48 56 64 72 80 A random maze: Number of rows = 8 Number of columns = 10 The maze: +--+--+--+--+--+--+--+--+--+--+ | | | | | | | | + + + + + +--+--+--+ + + | | | | + +--+ +--+ +--+--+--+ +--+ | | | | | + +--+ +--+ +--+--+--+--+--+ | | | | | + +--+ +--+ +--+--+--+--+ + | | | | | + + +--+--+ +--+--+--+--+ + | | | | | + +--+--+--+ + +--+ + +--+ | | | | | + + +--+ + + + +--+--+ + | | | | | | +--+--+--+--+--+--+--+--+--+--+ Rooted tree representation: (0 is the root. All other cells print the cell number of their parent on the tree.) 2 10 18 26 34 33 41 49 66 74 3 18 19 34 35 34 42 50 58 66 4 19 20 19 36 35 43 51 66 67 5 4 21 20 37 36 44 52 60 77 6 14 29 37 38 37 45 53 77 78 14 22 30 38 39 47 62 63 71 70 6 16 15 32 0 39 47 55 63 71 7 24 32 40 39 47 55 56 64 79 Random maze with far apart ends: Diameter = 21 Starting cell = 1 10 Stopping cell = 4 10 The maze: +--+--+--+--+--+--+--+--+--+--+ | | | | | | |00| + + + + + +--+--+--+ + + | | | | + +--+ +--+ +--+--+--+ +--+ | | | | | + +--+ +--+ +--+--+--+--+--+ | | | |$$| + +--+ +--+ +--+--+--+--+ + | | | | | + + +--+--+ +--+--+--+--+ + | | | | | + +--+--+--+ + +--+ + +--+ | | | | | + + +--+ + + + +--+--+ + | | | | | | +--+--+--+--+--+--+--+--+--+--+ Random maze with path from start to stop: The maze +--+--+--+--+--+--+--+--+--+--+ | | | | | | |00| + + + + + +--+--+--+ +**+ | | | *****************| + +--+ +--+**+--+--+--+ +--+ | | |** | | + +--+ +--+**+--+--+--+--+--+ | | |** |$$| + +--+ +--+**+--+--+--+--+**+ | | | ** | **| + + +--+--+**+--+--+--+--+**+ | **| | |*****| + +--+--+--+**+ +--+ +**+--+ | | | |************** | + + +--+ + + + +--+--+ + | | | | | | +--+--+--+--+--+--+--+--+--+--+ maze_print_test(): maze_print() prints a maze with path marked. The maze: +--+--+ |*****|$$ +**+**+**+ |00|*****| + +--+--+ maze_random_test(): maze_random() generate a random maze. Cell numbers for the maze: 1 9 17 25 33 41 49 57 65 73 2 10 18 26 34 42 50 58 66 74 3 11 19 27 35 43 51 59 67 75 4 12 20 28 36 44 52 60 68 76 5 13 21 29 37 45 53 61 69 77 6 14 22 30 38 46 54 62 70 78 7 15 23 31 39 47 55 63 71 79 8 16 24 32 40 48 56 64 72 80 A random maze: Number of rows = 8 Number of columns = 10 The maze: +--+--+--+--+--+--+--+--+--+--+ | | | + +--+ + +--+ + + + + + | | | | | | | | + +--+--+ + +--+--+--+ +--+ | | | | | + + +--+--+--+ + + + +--+ | | | | | | | + +--+--+--+ +--+ +--+ + + | | | | | | +--+ + +--+ +--+ +--+ + + | | | | | | | | +--+ +--+ + +--+--+ + + + | | | | | | + + + + + +--+ +--+ +--+ | | | | | | | | +--+--+--+--+--+--+--+--+--+--+ Rooted tree representation: (0 is the root. All other cells print the cell number of their parent on the tree.) 9 17 25 26 25 33 50 49 57 65 1 18 17 0 26 41 42 57 65 73 2 3 27 26 34 35 43 51 66 67 3 11 28 36 44 43 51 59 67 68 4 21 29 37 36 53 52 69 68 76 14 13 21 38 37 38 53 63 69 77 15 14 15 30 38 39 63 71 70 78 7 15 23 31 39 56 55 72 71 72 maze_test(): Normal end of execution. 28 February 2023 8:46:26.281 AM