--- deliantra/server/random_maps/maze_gen.C 2006/09/14 22:34:02 1.4 +++ deliantra/server/random_maps/maze_gen.C 2007/01/18 19:42:10 1.6 @@ -1,3 +1,4 @@ + /* peterm@langmuir.eecs.berkeley.edu: this function generates a random blocked maze with the property that there is only one path from one spot to any other, and there is always a path from one spot to any other. @@ -230,34 +231,34 @@ count = 0; switch (dirlist[count]) { - case 1: /* up */ - { - *y = yc + 1; - *x = xc; - break; - }; - case 2: /* down */ - { - *y = yc - 1; - *x = xc; - break; - }; - case 3: /* right */ - { - *y = yc; - *x = xc + 1; - break; - } - case 4: /* left */ - { - *x = xc - 1; - *y = yc; - break; - } - default: /* ??? */ - { - return -1; - } + case 1: /* up */ + { + *y = yc + 1; + *x = xc; + break; + }; + case 2: /* down */ + { + *y = yc - 1; + *x = xc; + break; + }; + case 3: /* right */ + { + *y = yc; + *x = xc + 1; + break; + } + case 4: /* left */ + { + *x = xc - 1; + *y = yc; + break; + } + default: /* ??? */ + { + return -1; + } } return 1; } @@ -274,7 +275,7 @@ maze[x][y] = '#'; /* decide if we're going to pick from the wall_free_list */ - if (RANDOM () % 4 && wall_free_size > 0) + if (rndm (4) && wall_free_size > 0) { pop_wall_point (&xc, &yc); fill_maze_full (maze, xc, yc, xsize, ysize); @@ -300,7 +301,7 @@ maze[x][y] = '#'; /* decide if we're going to pick from the wall_free_list */ - if (RANDOM () % 4 && wall_free_size > 0) + if (rndm (4) && wall_free_size > 0) { pop_wall_point (&xc, &yc); fill_maze_sparse (maze, xc, yc, xsize, ysize);