… | |
… | |
34 | this->h = h; |
34 | this->h = h; |
35 | |
35 | |
36 | // we store the layout in a single contiguous memory layout |
36 | // we store the layout in a single contiguous memory layout |
37 | // first part consists of pointers to each column, followed |
37 | // first part consists of pointers to each column, followed |
38 | // by the actual columns (not rows!) |
38 | // by the actual columns (not rows!) |
39 | int size = (sizeof (cell *) + sizeof (cell) * h) * w; |
39 | size = (sizeof (cell *) + sizeof (cell) * h) * w; |
40 | |
|
|
41 | data = (cell **)salloc<char> (size); |
40 | data = (cell **)salloc<char> (size); |
42 | |
41 | |
43 | cell *p = (cell *)(data + w); |
42 | cell *p = (cell *)(data + w); |
44 | |
43 | |
45 | for (int x = w; x--; ) |
44 | for (int x = 0; x < w; ++x) |
46 | data [x] = p + x * h; |
45 | data [x] = p + x * h; |
47 | } |
46 | } |
48 | |
47 | |
49 | layout::layout (int w, int h) |
48 | layout::layout (int w, int h) |
50 | { |
49 | { |
… | |
… | |
56 | alloc (copy.w, copy.h); |
55 | alloc (copy.w, copy.h); |
57 | |
56 | |
58 | memcpy (data [0], copy.data [0], sizeof (cell) * h * w); |
57 | memcpy (data [0], copy.data [0], sizeof (cell) * h * w); |
59 | } |
58 | } |
60 | |
59 | |
|
|
60 | layout::layout (layout &orig, int x1, int y1, int x2, int y2) |
|
|
61 | { |
|
|
62 | w = x2 - x1; |
|
|
63 | h = y2 - y1; |
|
|
64 | |
|
|
65 | // we only allocate space for the pointers |
|
|
66 | size = sizeof (cell *) * w; |
|
|
67 | data = (cell **)salloc<char> (size); |
|
|
68 | |
|
|
69 | // and now we point back into the original layout |
|
|
70 | for (int x = 0; x < w; ++x) |
|
|
71 | data [x] = orig.data [x + x1] + y1; |
|
|
72 | } |
|
|
73 | |
61 | layout::~layout () |
74 | layout::~layout () |
62 | { |
75 | { |
63 | int size = (sizeof (cell *) + sizeof (cell) * h) * w; |
|
|
64 | |
|
|
65 | sfree ((char *)data, size); |
76 | sfree ((char *)data, size); |
66 | } |
77 | } |
67 | |
78 | |
68 | void |
79 | void |
69 | layout::fill (char fill) |
80 | layout::fill (char fill) |
70 | { |
81 | { |
71 | memset (data [0], fill, w * h); |
82 | //memset (data [0], fill, w * h); // only when contiguous :/ |
|
|
83 | fill_rect (0, 0, w, h, fill); |
72 | } |
84 | } |
73 | |
85 | |
74 | void |
86 | void |
75 | layout::rect (int x1, int y1, int x2, int y2, char fill) |
87 | layout::rect (int x1, int y1, int x2, int y2, char fill) |
76 | { |
88 | { |
… | |
… | |
98 | void |
110 | void |
99 | layout::fill_rand (int percent) |
111 | layout::fill_rand (int percent) |
100 | { |
112 | { |
101 | percent = lerp (percent, 0, 100, 0, 256); |
113 | percent = lerp (percent, 0, 100, 0, 256); |
102 | |
114 | |
103 | for (int x = w - 1; --x > 0; ) |
115 | for (int x = 0; x < w; ++x) |
104 | for (int y = h - 1; --y > 0; ) |
116 | for (int y = 0; y < h; ++y) |
105 | data [x][y] = rmg_rndm (256) > percent ? 0 : '#'; |
117 | data [x][y] = rmg_rndm (256) > percent ? 0 : '#'; |
106 | } |
118 | } |
107 | |
119 | |
108 | ///////////////////////////////////////////////////////////////////////////// |
120 | ///////////////////////////////////////////////////////////////////////////// |
109 | |
121 | |
… | |
… | |
203 | ++y; |
215 | ++y; |
204 | } |
216 | } |
205 | |
217 | |
206 | while (--y >= y0) |
218 | while (--y >= y0) |
207 | { |
219 | { |
208 | if (x > 0) push_flood_fill (dist, seeds, x - 1, y); |
220 | if (x > 0 && !dist [x - 1][y]) push_flood_fill (dist, seeds, x - 1, y); |
209 | if (x < dist.w - 1) push_flood_fill (dist, seeds, x + 1, y); |
221 | if (x < dist.w - 1 && !dist [x + 1][y]) push_flood_fill (dist, seeds, x + 1, y); |
210 | } |
222 | } |
211 | } |
223 | } |
212 | |
224 | |
213 | static inline void |
225 | static inline void |
214 | make_tunnel (layout &dist, pointlist &seeds, int x, int y, U8 d) |
226 | make_tunnel (layout &dist, pointlist &seeds, int x, int y, U8 d, int perturb) |
215 | { |
227 | { |
216 | for (;;) |
228 | for (;;) |
217 | { |
229 | { |
218 | point neigh[4]; |
230 | point neigh[4]; |
219 | int ncnt = 0; |
231 | int ncnt = 0; |
220 | |
232 | |
|
|
233 | d += perturb > 1; |
|
|
234 | |
221 | if (x > 1 && U8 (dist [x - 1][y]) <= d && dist [x - 1][y] > 1) neigh [ncnt++] = point (x - 1, y); |
235 | if (x > 0 && U8 (dist [x - 1][y]) < d && dist [x - 1][y] > 1) neigh [ncnt++] = point (x - 1, y); |
222 | if (x < dist.w - 2 && U8 (dist [x + 1][y]) <= d && dist [x + 1][y] > 1) neigh [ncnt++] = point (x + 1, y); |
236 | if (x < dist.w - 1 && U8 (dist [x + 1][y]) < d && dist [x + 1][y] > 1) neigh [ncnt++] = point (x + 1, y); |
223 | if (y > 1 && U8 (dist [x][y - 1]) <= d && dist [x][y - 1] > 1) neigh [ncnt++] = point (x, y - 1); |
237 | if (y > 0 && U8 (dist [x][y - 1]) < d && dist [x][y - 1] > 1) neigh [ncnt++] = point (x, y - 1); |
224 | if (y < dist.h - 2 && U8 (dist [x][y + 1]) <= d && dist [x][y + 1] > 1) neigh [ncnt++] = point (x, y + 1); |
238 | if (y < dist.h - 1 && U8 (dist [x][y + 1]) < d && dist [x][y + 1] > 1) neigh [ncnt++] = point (x, y + 1); |
225 | |
239 | |
226 | if (!ncnt) |
240 | if (!ncnt) |
227 | return; |
241 | return; |
228 | |
242 | |
229 | point &p = neigh [rmg_rndm (ncnt)]; |
243 | point p = neigh [perturb ? rmg_rndm (ncnt) : 0]; |
230 | |
244 | |
231 | seeds.push (p); |
245 | seeds.push (p); |
232 | |
246 | |
233 | x = p.x; |
247 | x = p.x; |
234 | y = p.y; |
248 | y = p.y; |
… | |
… | |
252 | } |
266 | } |
253 | |
267 | |
254 | // isolation remover, works on a "distance" map |
268 | // isolation remover, works on a "distance" map |
255 | // the map must be initialised with 0 == rooms, 255 = walls |
269 | // the map must be initialised with 0 == rooms, 255 = walls |
256 | static void noinline |
270 | static void noinline |
257 | isolation_remover (layout &dist) |
271 | isolation_remover (layout &dist, unsigned int perturb = 2) |
258 | { |
272 | { |
259 | // dist contains |
273 | // dist contains |
260 | // 0 == invisited rooms |
274 | // 0 == invisited rooms |
261 | // 1 == visited rooms |
275 | // 1 == visited rooms |
262 | // 2+ shortest distance to random near room |
276 | // 2+ shortest distance to random near room |
263 | |
277 | |
|
|
278 | clamp_it (perturb, 0, 2); |
|
|
279 | |
264 | // phase 1, find seed |
280 | // phase 1, find seed |
265 | int cnt = 0; |
281 | int cnt = 0; |
266 | int x, y; |
282 | int x, y; |
267 | |
283 | |
268 | for (int i = 0; i < dist.w; ++i) |
284 | for (int i = 0; i < dist.w; ++i) |
… | |
… | |
272 | |
288 | |
273 | if (!cnt) |
289 | if (!cnt) |
274 | { |
290 | { |
275 | // map is completely massive, this is not good, |
291 | // map is completely massive, this is not good, |
276 | // so make it empty instead. |
292 | // so make it empty instead. |
277 | dist.clear (); |
293 | dist.fill (1); |
278 | dist.border (255); |
|
|
279 | return; |
294 | return; |
280 | } |
295 | } |
281 | |
296 | |
282 | fixed_stack<point> seeds (dist.w * dist.h * 5); |
297 | fixed_stack<point> seeds (dist.w * dist.h * 5); |
283 | |
298 | |
… | |
… | |
300 | |
315 | |
301 | if (!dist [x][y]) |
316 | if (!dist [x][y]) |
302 | { |
317 | { |
303 | // found new isolated area, make tunnel |
318 | // found new isolated area, make tunnel |
304 | push_flood_fill (dist, seeds, x, y); |
319 | push_flood_fill (dist, seeds, x, y); |
305 | make_tunnel (dist, seeds, x, y, 255); |
320 | make_tunnel (dist, seeds, x, y, 254, perturb); |
306 | } |
321 | } |
307 | else |
322 | else |
308 | { |
323 | { |
309 | // nothing here, continue to expand |
324 | // nothing here, continue to expand |
310 | U8 d = U8 (dist [x][y]) + 1; |
325 | U8 d = U8 (dist [x][y]) + 1; |
… | |
… | |
316 | } |
331 | } |
317 | } |
332 | } |
318 | } |
333 | } |
319 | |
334 | |
320 | void |
335 | void |
321 | layout::isolation_remover () |
336 | layout::isolation_remover (int perturb) |
322 | { |
337 | { |
323 | layout dist (w, h); |
338 | layout dist (w - 2, h - 2); // map without border |
324 | |
339 | |
325 | for (int x = 0; x < w; ++x) |
340 | for (int x = 1; x < w - 1; ++x) |
326 | for (int y = 0; y < h; ++y) |
341 | for (int y = 1; y < h - 1; ++y) |
327 | dist [x][y] = data [x][y] == '#' ? U8 (255) : 0; |
342 | dist [x - 1][y - 1] = data [x][y] == '#' ? U8 (255) : 0; |
328 | |
343 | |
329 | ::isolation_remover (dist); |
344 | ::isolation_remover (dist, perturb); |
330 | |
345 | |
331 | // now copy the tunnels over |
346 | // now copy the tunnels over |
332 | for (int x = 0; x < w; ++x) |
347 | for (int x = 1; x < w - 1; ++x) |
333 | for (int y = 0; y < h; ++y) |
348 | for (int y = 1; y < h - 1; ++y) |
334 | if (data [x][y] == '#' && dist [x][y] == 1) |
349 | if (data [x][y] == '#' && dist [x - 1][y - 1] == 1) |
335 | data [x][y] = 0; |
350 | data [x][y] = 0; |
336 | } |
351 | } |
337 | |
352 | |
338 | ///////////////////////////////////////////////////////////////////////////// |
353 | ///////////////////////////////////////////////////////////////////////////// |
339 | |
354 | |
340 | // inspired mostly by http://www.jimrandomh.org/misc/caves.txt |
|
|
341 | void |
|
|
342 | layout::gen_cave (int subtype) |
|
|
343 | { |
|
|
344 | switch (subtype) |
|
|
345 | { |
|
|
346 | // a rough cave |
|
|
347 | case 0: |
|
|
348 | fill_rand (rmg_rndm (85, 97)); |
|
|
349 | break; |
|
|
350 | |
|
|
351 | // corridors |
|
|
352 | case 1: |
|
|
353 | fill_rand (rmg_rndm (5, 40)); |
|
|
354 | erode_1_2 (5, 2, 10); |
|
|
355 | erode_1_2 (5, -1, 10); |
|
|
356 | erode_1_2 (5, 2, 1); |
|
|
357 | break; |
|
|
358 | |
|
|
359 | // somewhat open, roundish |
|
|
360 | case 2: |
|
|
361 | fill_rand (45); |
|
|
362 | erode_1_2 (5, 0, 5); |
|
|
363 | erode_1_2 (5, 1, 1); |
|
|
364 | break; |
|
|
365 | |
|
|
366 | // wide open, some room-like structures |
|
|
367 | case 3: |
|
|
368 | fill_rand (45); |
|
|
369 | erode_1_2 (5, 2, 4); |
|
|
370 | erode_1_2 (5, -1, 3); |
|
|
371 | break; |
|
|
372 | } |
|
|
373 | |
|
|
374 | border (); |
|
|
375 | isolation_remover (); |
|
|
376 | } |
|
|
377 | |
|
|
378 | ///////////////////////////////////////////////////////////////////////////// |
|
|
379 | |
|
|
380 | //+GPL |
355 | //+GPL |
381 | |
356 | |
382 | /* puts doors at appropriate locations in a maze. */ |
357 | /* puts doors at appropriate locations in a maze. */ |
383 | void |
358 | void |
384 | layout::doorify () |
359 | layout::doorify () |
385 | { |
360 | { |
386 | int ndoors = w * h / 60; /* reasonable number of doors. */ |
361 | int ndoors = w * h / 60; /* reasonable number of doors. */ |
387 | int doorlocs = 0; /* # of available doorlocations */ |
|
|
388 | |
362 | |
389 | uint16 *doorlist_x = salloc<uint16> (w * h); |
363 | fixed_stack<point> doorloc (w * h); |
390 | uint16 *doorlist_y = salloc<uint16> (w * h); |
|
|
391 | |
364 | |
392 | /* make a list of possible door locations */ |
365 | /* make a list of possible door locations */ |
393 | for (int i = 1; i < w - 1; i++) |
366 | for (int i = 1; i < w - 1; i++) |
394 | for (int j = 1; j < h - 1; j++) |
367 | for (int j = 1; j < h - 1; j++) |
395 | { |
368 | { |
396 | int sindex = surround_flag (*this, i, j); |
369 | int sindex = surround_flag (*this, i, j); |
397 | |
370 | |
398 | if (sindex == 3 || sindex == 12) /* these are possible door sindex */ |
371 | if (sindex == 3 || sindex == 12) /* these are possible door sindex */ |
399 | { |
372 | doorloc.push (point (i, j)); |
400 | doorlist_x [doorlocs] = i; |
|
|
401 | doorlist_y [doorlocs] = j; |
|
|
402 | doorlocs++; |
|
|
403 | } |
|
|
404 | } |
373 | } |
405 | |
374 | |
406 | while (ndoors > 0 && doorlocs > 0) |
375 | while (ndoors && doorloc.size) |
407 | { |
376 | { |
408 | int di = rmg_rndm (doorlocs); |
377 | point p = doorloc.remove (rmg_rndm (doorloc.size)); |
409 | int i = doorlist_x [di]; |
378 | |
410 | int j = doorlist_y [di]; |
|
|
411 | int sindex = surround_flag (*this, i, j); |
379 | int sindex = surround_flag (*this, p.x, p.y); |
412 | |
380 | |
413 | if (sindex == 3 || sindex == 12) /* these are possible door sindex */ |
381 | if (sindex == 3 || sindex == 12) /* these are possible door sindex */ |
414 | { |
382 | { |
415 | data [i][j] = 'D'; |
383 | data [p.x][p.y] = 'D'; |
416 | ndoors--; |
384 | --ndoors; |
417 | } |
385 | } |
418 | |
|
|
419 | /* reduce the size of the list */ |
|
|
420 | doorlocs--; |
|
|
421 | doorlist_x[di] = doorlist_x [doorlocs]; |
|
|
422 | doorlist_y[di] = doorlist_y [doorlocs]; |
|
|
423 | } |
386 | } |
424 | |
|
|
425 | sfree (doorlist_x, w * h); |
|
|
426 | sfree (doorlist_y, w * h); |
|
|
427 | } |
387 | } |
428 | |
388 | |
429 | /* takes a map and makes it symmetric: adjusts Xsize and |
389 | /* takes a map and makes it symmetric: adjusts Xsize and |
430 | * Ysize to produce a symmetric map. |
390 | * Ysize to produce a symmetric map. |
431 | */ |
391 | */ |
… | |
… | |
741 | |
701 | |
742 | return -1; |
702 | return -1; |
743 | } |
703 | } |
744 | |
704 | |
745 | int |
705 | int |
746 | make_wall (char **maze, int x, int y, int dir) |
706 | make_wall (layout &maze, int x, int y, int dir) |
747 | { |
707 | { |
748 | maze[x][y] = 'D'; /* mark a door */ |
708 | maze[x][y] = 'D'; /* mark a door */ |
749 | |
709 | |
750 | switch (dir) |
710 | switch (dir) |
751 | { |
711 | { |
… | |
… | |
800 | else |
760 | else |
801 | make_wall (*this, dx, dy, 1); |
761 | make_wall (*this, dx, dy, 1); |
802 | } |
762 | } |
803 | } |
763 | } |
804 | |
764 | |
|
|
765 | //-GPL |
|
|
766 | |
805 | ///////////////////////////////////////////////////////////////////////////// |
767 | ///////////////////////////////////////////////////////////////////////////// |
|
|
768 | |
|
|
769 | // inspired mostly by http://www.jimrandomh.org/misc/caves.txt |
|
|
770 | void |
|
|
771 | layout::gen_cave (int subtype) |
|
|
772 | { |
|
|
773 | switch (subtype) |
|
|
774 | { |
|
|
775 | // a rough cave |
|
|
776 | case 0: |
|
|
777 | fill_rand (rmg_rndm (85, 97)); |
|
|
778 | break; |
|
|
779 | |
|
|
780 | // corridors |
|
|
781 | case 1: |
|
|
782 | fill_rand (rmg_rndm (5, 40)); |
|
|
783 | erode_1_2 (5, 2, 10); |
|
|
784 | erode_1_2 (5, -1, 10); |
|
|
785 | erode_1_2 (5, 2, 1); |
|
|
786 | break; |
|
|
787 | |
|
|
788 | // somewhat open, some room-like structures |
|
|
789 | case 2: |
|
|
790 | fill_rand (45); |
|
|
791 | erode_1_2 (5, 2, 4); |
|
|
792 | erode_1_2 (5, -1, 3); |
|
|
793 | break; |
|
|
794 | |
|
|
795 | // wide open, roundish |
|
|
796 | case 3: |
|
|
797 | fill_rand (45); |
|
|
798 | erode_1_2 (5, 0, 5); |
|
|
799 | erode_1_2 (5, 1, 1); |
|
|
800 | break; |
|
|
801 | } |
|
|
802 | |
|
|
803 | border (); |
|
|
804 | isolation_remover (1); |
|
|
805 | } |
|
|
806 | |
|
|
807 | void |
|
|
808 | layout::gen_castle () |
|
|
809 | { |
|
|
810 | fill ('#'); |
|
|
811 | |
|
|
812 | for (int n = w * h / 30 + 1; n--; ) |
|
|
813 | { |
|
|
814 | int rw = rmg_rndm (6, 10); |
|
|
815 | int rh = rmg_rndm (6, 10); |
|
|
816 | |
|
|
817 | if (rw > w || rh > h) |
|
|
818 | continue; |
|
|
819 | |
|
|
820 | int rx = rmg_rndm (0, w - rw); |
|
|
821 | int ry = rmg_rndm (0, h - rh); |
|
|
822 | |
|
|
823 | rect (rx, ry, rx + rw, ry + rh, '#'); |
|
|
824 | fill_rect (rx + 1, ry + 1, rx + rw - 1, ry + rh - 1, 0); |
|
|
825 | } |
|
|
826 | |
|
|
827 | border (); |
|
|
828 | isolation_remover (0); |
|
|
829 | } |
|
|
830 | |
|
|
831 | static void |
|
|
832 | gen_mixed_ (layout &maze, random_map_params *RP) |
|
|
833 | { |
|
|
834 | if (maze.w > maze.h && maze.w > 16) |
|
|
835 | { |
|
|
836 | int m = rmg_rndm (8, maze.w - 8); |
|
|
837 | |
|
|
838 | layout m1 (maze, 0, 0, m , maze.h); gen_mixed_ (m1, RP); |
|
|
839 | layout m2 (maze, m, 0, maze.w, maze.h); gen_mixed_ (m2, RP); |
|
|
840 | } |
|
|
841 | else if (maze.h > 16) |
|
|
842 | { |
|
|
843 | int m = rmg_rndm (8, maze.h - 8); |
|
|
844 | |
|
|
845 | layout m1 (maze, 0, 0, maze.w, m ); gen_mixed_ (m1, RP); |
|
|
846 | layout m2 (maze, 0, m, maze.w, maze.h); gen_mixed_ (m2, RP); |
|
|
847 | } |
|
|
848 | else |
|
|
849 | { |
|
|
850 | RP->map_layout_style = rmg_rndm (NROFLAYOUTS - 2) + 1; |
|
|
851 | |
|
|
852 | if (RP->map_layout_style == LAYOUT_MULTIPLE) |
|
|
853 | ++RP->map_layout_style; |
|
|
854 | |
|
|
855 | maze.generate (RP); |
|
|
856 | } |
|
|
857 | } |
|
|
858 | |
|
|
859 | // recursive subdivision with random sublayouts |
|
|
860 | static void |
|
|
861 | gen_mixed (layout &maze, random_map_params *RP) |
|
|
862 | { |
|
|
863 | random_map_params &rp = *new random_map_params (RP); |
|
|
864 | gen_mixed_ (maze, &rp); |
|
|
865 | delete &rp; |
|
|
866 | |
|
|
867 | maze.border (); |
|
|
868 | maze.isolation_remover (0); |
|
|
869 | } |
|
|
870 | |
|
|
871 | //+GPL |
806 | |
872 | |
807 | /* function selects the maze function and gives it whatever |
873 | /* function selects the maze function and gives it whatever |
808 | arguments it needs. */ |
874 | arguments it needs. */ |
809 | void |
875 | void |
810 | layout::generate (random_map_params *RP) |
876 | layout::generate (random_map_params *RP) |
… | |
… | |
870 | if (rmg_rndm (2)) |
936 | if (rmg_rndm (2)) |
871 | doorify (); |
937 | doorify (); |
872 | |
938 | |
873 | break; |
939 | break; |
874 | |
940 | |
|
|
941 | case LAYOUT_CASTLE: |
|
|
942 | gen_castle (); |
|
|
943 | |
|
|
944 | if (rmg_rndm (2)) |
|
|
945 | doorify (); |
|
|
946 | |
|
|
947 | break; |
|
|
948 | |
|
|
949 | case LAYOUT_MULTIPLE: |
|
|
950 | gen_mixed (*this, RP); |
|
|
951 | break; |
|
|
952 | |
875 | default: |
953 | default: |
876 | abort (); |
954 | abort (); |
877 | } |
955 | } |
|
|
956 | } |
878 | |
957 | |
879 | /* rotate the maze randomly */ |
958 | //-GPL |
880 | rotate (rmg_rndm (4)); |
|
|
881 | |
|
|
882 | symmetrize (RP->symmetry_used); |
|
|
883 | |
959 | |
884 | #if 0 |
960 | #if 0 |
885 | print ();//D |
961 | static void |
886 | #endif |
962 | gen_village (layout &maze) |
|
|
963 | { |
|
|
964 | maze.clear (); |
|
|
965 | maze.border (); |
887 | |
966 | |
888 | if (RP->expand2x) |
967 | for (int n = maze.w * maze.h / 200 + 1; n--; ) |
889 | expand2x (); |
968 | { |
890 | } |
969 | int rw = rmg_rndm (6, 10); |
|
|
970 | int rh = rmg_rndm (6, 10); |
891 | |
971 | |
892 | //-GPL |
972 | int rx = rmg_rndm (2, maze.w - rw - 2); |
|
|
973 | int ry = rmg_rndm (2, maze.h - rh - 2); |
893 | |
974 | |
894 | #if 0 |
975 | maze.rect (rx, ry, rx + rw, ry + rh, '#'); |
|
|
976 | } |
|
|
977 | |
|
|
978 | maze.border (); |
|
|
979 | maze.isolation_remover (2); |
|
|
980 | } |
|
|
981 | |
895 | static struct demo |
982 | static struct demo |
896 | { |
983 | { |
897 | demo () |
984 | demo () |
898 | { |
985 | { |
899 | rmg_rndm.seed (time (0)); |
986 | rmg_rndm.seed (time (0)); |
900 | |
987 | |
901 | for(int i=1;i<100;i++) |
988 | for(int i=1;i<100;i++) |
902 | { |
989 | { |
903 | layout maze (40, 25); |
990 | layout maze (40, 30); |
904 | maze.fill_rand (85); |
991 | gen_village (maze); |
905 | maze.border (); |
992 | maze.doorify (); |
906 | maze.isolation_remover (); |
|
|
907 | maze.print (); |
993 | maze.print (); |
|
|
994 | exit(0); |
908 | } |
995 | } |
909 | |
996 | |
910 | exit (1); |
997 | exit (1); |
911 | } |
998 | } |
912 | } demo; |
999 | } demo; |