ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/random_maps/layout.C
(Generate patch)

Comparing deliantra/server/random_maps/layout.C (file contents):
Revision 1.10 by root, Sat Jul 3 00:39:57 2010 UTC vs.
Revision 1.29 by root, Tue Jan 3 11:25:33 2012 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) Crossfire Development Team (restored, original file without copyright notice) 5 * Copyright (©) 1994-2004 Crossfire Development Team (restored, original file without copyright notice)
6 * 6 *
7 * Deliantra is free software: you can redistribute it and/or modify it under 7 * Deliantra is free software: you can redistribute it and/or modify it under
8 * the terms of the Affero GNU General Public License as published by the 8 * the terms of the Affero GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your 9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version. 10 * option) any later version.
20 * 20 *
21 * The authors can be reached via e-mail to <support@deliantra.net> 21 * The authors can be reached via e-mail to <support@deliantra.net>
22 */ 22 */
23 23
24#include <global.h> 24#include <global.h>
25#include <random_map.h> 25#include <rmg.h>
26#include <rproto.h> 26#include <rproto.h>
27 27
28void 28void noinline
29layout::alloc (int w, int h) 29layout::alloc (int w, int h)
30{ 30{
31 assert (sizeof (cell) == 1); 31 assert (sizeof (cell) == 1);
32 32
33 this->w = w; 33 this->w = w;
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
49layout::layout (int w, int h) 48layout::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
60layout::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
61layout::~layout () 74layout::~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
68void 79void noinline
69layout::fill (char fill) 80layout::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
74void 86void noinline
87layout::replace (char from, char to)
88{
89 for (int x = 0; x < w; ++x)
90 for (int y = 0; y < h; ++y)
91 if (data [x][y] == from)
92 data [x][y] = to;
93}
94
95void noinline
75layout::rect (int x1, int y1, int x2, int y2, char fill) 96layout::rect (int x1, int y1, int x2, int y2, char fill)
76{ 97{
77 --x2; 98 --x2;
78 99
79 memset (data [x1] + y1, fill, y2 - y1); 100 memset (data [x1] + y1, fill, y2 - y1);
81 102
82 while (++x1 < x2) 103 while (++x1 < x2)
83 data [x1][y1] = data [x1][y2 - 1] = fill; 104 data [x1][y1] = data [x1][y2 - 1] = fill;
84} 105}
85 106
86void 107void noinline
87layout::fill_rect (int x1, int y1, int x2, int y2, char fill) 108layout::fill_rect (int x1, int y1, int x2, int y2, char fill)
88{ 109{
89 for (; x1 < x2; ++x1) 110 for (; x1 < x2; ++x1)
90 memset (data [x1] + y1, fill, y2 - y1); 111 memset (data [x1] + y1, fill, y2 - y1);
91} 112}
92 113
114void
93void layout::border (char fill) 115layout::border (char fill)
94{ 116{
95 rect (0, 0, w, h, fill); 117 rect (0, 0, w, h, fill);
96} 118}
97 119
98void 120void noinline
99layout::fill_rand (int percent) 121layout::fill_rand (int percent)
100{ 122{
101 percent = lerp (percent, 0, 100, 0, 256); 123 percent = lerp (percent, 0, 100, 0, 256);
102 124
103 for (int x = w - 1; --x > 0; ) 125 for (int x = 0; x < w; ++x)
104 for (int y = h - 1; --y > 0; ) 126 for (int y = 0; y < h; ++y)
105 data [x][y] = rmg_rndm (256) > percent ? 0 : '#'; 127 data [x][y] = rmg_rndm (256) > percent ? 0 : '#';
106} 128}
107 129
108///////////////////////////////////////////////////////////////////////////// 130/////////////////////////////////////////////////////////////////////////////
109 131
110// erode by cellular automata 132// erode by cellular automata
111void 133void noinline
112layout::erode_1_2 (int c1, int c2, int repeat) 134layout::erode_1_2 (int c1, int c2, int repeat)
113{ 135{
114 layout neu (w, h); 136 layout neu (w, h);
115 137
116 while (repeat--) 138 while (repeat--)
203 ++y; 225 ++y;
204 } 226 }
205 227
206 while (--y >= y0) 228 while (--y >= y0)
207 { 229 {
208 if (x > 0) push_flood_fill (dist, seeds, x - 1, y); 230 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); 231 if (x < dist.w - 1 && !dist [x + 1][y]) push_flood_fill (dist, seeds, x + 1, y);
210 } 232 }
211} 233}
212 234
213static inline void 235static void inline
214make_tunnel (layout &dist, pointlist &seeds, int x, int y, U8 d) 236make_tunnel (layout &dist, pointlist &seeds, int x, int y, U8 d, int perturb)
215{ 237{
216 for (;;) 238 for (;;)
217 { 239 {
218 point neigh[4]; 240 point neigh[4];
219 int ncnt = 0; 241 int ncnt = 0;
220 242
243 d += perturb > 1;
244
221 if (x > 1 && U8 (dist [x - 1][y]) <= d && dist [x - 1][y] > 1) neigh [ncnt++] = point (x - 1, y); 245 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); 246 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); 247 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); 248 if (y < dist.h - 1 && U8 (dist [x][y + 1]) < d && dist [x][y + 1] > 1) neigh [ncnt++] = point (x, y + 1);
225 249
226 if (!ncnt) 250 if (!ncnt)
227 return; 251 return;
228 252
229 point &p = neigh [rmg_rndm (ncnt)]; 253 point p = neigh [perturb ? rmg_rndm (ncnt) : 0];
230 254
231 seeds.push (p); 255 seeds.push (p);
232 256
233 x = p.x; 257 x = p.x;
234 y = p.y; 258 y = p.y;
252} 276}
253 277
254// isolation remover, works on a "distance" map 278// isolation remover, works on a "distance" map
255// the map must be initialised with 0 == rooms, 255 = walls 279// the map must be initialised with 0 == rooms, 255 = walls
256static void noinline 280static void noinline
257isolation_remover (layout &dist) 281isolation_remover (layout &dist, unsigned int perturb = 2)
258{ 282{
259 // dist contains 283 // dist contains
260 // 0 == invisited rooms 284 // 0 == invisited rooms
261 // 1 == visited rooms 285 // 1 == visited rooms
262 // 2+ shortest distance to random near room 286 // 2+ shortest distance to random near room
263 287
288 clamp_it (perturb, 0, 2);
289
264 // phase 1, find seed 290 // phase 1, find seed
265 int cnt = 0; 291 int cnt = 0;
266 int x, y; 292 int x, y;
267 293
268 for (int i = 0; i < dist.w; ++i) 294 for (int i = 0; i < dist.w; ++i)
272 298
273 if (!cnt) 299 if (!cnt)
274 { 300 {
275 // map is completely massive, this is not good, 301 // map is completely massive, this is not good,
276 // so make it empty instead. 302 // so make it empty instead.
277 dist.clear (); 303 dist.fill (1);
278 dist.border (255);
279 return; 304 return;
280 } 305 }
281 306
282 fixed_stack<point> seeds (dist.w * dist.h * 5); 307 fixed_stack<point> seeds (dist.w * dist.h * 5);
283 308
287 seeds.push (point (x, y)); 312 seeds.push (point (x, y));
288 313
289 // phase 2, while we have seeds, if 314 // phase 2, while we have seeds, if
290 // seed is empty, floodfill, else grow 315 // seed is empty, floodfill, else grow
291 316
317 int rem_index = 0; // used to remove "somewhat ordered"
318
292 while (seeds.size) 319 while (seeds.size)
293 { 320 {
294 coroapi::cede_to_tick (); 321 coroapi::cede_to_tick ();
295 322
323 int i = perturb
324 ? rmg_rndm (max (0, seeds.size - 8), seeds.size - 1)
325 : rem_index ++ % seeds.size;
326
296 point p = seeds.remove (rmg_rndm (seeds.size)); 327 point p = seeds.remove (i);
297 328
298 x = p.x; 329 x = p.x;
299 y = p.y; 330 y = p.y;
300 331
301 if (!dist [x][y]) 332 if (!dist [x][y])
302 { 333 {
303 // found new isolated area, make tunnel 334 // found new isolated area, make tunnel
304 push_flood_fill (dist, seeds, x, y); 335 push_flood_fill (dist, seeds, x, y);
305 make_tunnel (dist, seeds, x, y, 255); 336 make_tunnel (dist, seeds, x, y, 254, perturb);
306 } 337 }
307 else 338 else
308 { 339 {
309 // nothing here, continue to expand 340 // nothing here, continue to expand
310 U8 d = U8 (dist [x][y]) + 1; 341 U8 d = U8 (dist [x][y]) + 1;
316 } 347 }
317 } 348 }
318} 349}
319 350
320void 351void
321layout::isolation_remover () 352layout::isolation_remover (int perturb)
322{ 353{
323 layout dist (w, h); 354 layout dist (w - 2, h - 2); // map without border
324 355
325 for (int x = 0; x < w; ++x) 356 for (int x = 1; x < w - 1; ++x)
326 for (int y = 0; y < h; ++y) 357 for (int y = 1; y < h - 1; ++y)
327 dist [x][y] = data [x][y] == '#' ? U8 (255) : 0; 358 dist [x - 1][y - 1] = data [x][y] == '#' ? U8 (255) : 0;
328 359
329 ::isolation_remover (dist); 360 ::isolation_remover (dist, perturb);
330 361
331 // now copy the tunnels over 362 // now copy the tunnels over
332 for (int x = 0; x < w; ++x) 363 for (int x = 1; x < w - 1; ++x)
333 for (int y = 0; y < h; ++y) 364 for (int y = 1; y < h - 1; ++y)
334 if (data [x][y] == '#' && dist [x][y] == 1) 365 if (data [x][y] == '#' && dist [x - 1][y - 1] == 1)
335 data [x][y] = 0; 366 data [x][y] = 0;
336}
337
338/////////////////////////////////////////////////////////////////////////////
339
340// inspired mostly by http://www.jimrandomh.org/misc/caves.txt
341void
342layout::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} 367}
377 368
378///////////////////////////////////////////////////////////////////////////// 369/////////////////////////////////////////////////////////////////////////////
379 370
380//+GPL 371//+GPL
382/* puts doors at appropriate locations in a maze. */ 373/* puts doors at appropriate locations in a maze. */
383void 374void
384layout::doorify () 375layout::doorify ()
385{ 376{
386 int ndoors = w * h / 60; /* reasonable number of doors. */ 377 int ndoors = w * h / 60; /* reasonable number of doors. */
387 int doorlocs = 0; /* # of available doorlocations */
388 378
389 uint16 *doorlist_x = salloc<uint16> (w * h); 379 coroapi::cede_to_tick ();
390 uint16 *doorlist_y = salloc<uint16> (w * h); 380
381 fixed_stack<point> doorloc (w * h);
391 382
392 /* make a list of possible door locations */ 383 /* make a list of possible door locations */
393 for (int i = 1; i < w - 1; i++) 384 for (int i = 1; i < w - 1; i++)
394 for (int j = 1; j < h - 1; j++) 385 for (int j = 1; j < h - 1; j++)
395 { 386 {
396 int sindex = surround_flag (*this, i, j); 387 int sindex = surround_flag (*this, i, j);
397 388
398 if (sindex == 3 || sindex == 12) /* these are possible door sindex */ 389 if (sindex == 3 || sindex == 12) /* these are possible door sindex */
399 { 390 doorloc.push (point (i, j));
400 doorlist_x [doorlocs] = i;
401 doorlist_y [doorlocs] = j;
402 doorlocs++;
403 }
404 } 391 }
405 392
406 while (ndoors > 0 && doorlocs > 0) 393 while (ndoors && doorloc.size)
407 { 394 {
408 int di = rmg_rndm (doorlocs); 395 point p = doorloc.remove (rmg_rndm (doorloc.size));
409 int i = doorlist_x [di]; 396
410 int j = doorlist_y [di];
411 int sindex = surround_flag (*this, i, j); 397 int sindex = surround_flag (*this, p.x, p.y);
412 398
413 if (sindex == 3 || sindex == 12) /* these are possible door sindex */ 399 if (sindex == 3 || sindex == 12) /* these are possible door sindex */
414 { 400 {
415 data [i][j] = 'D'; 401 data [p.x][p.y] = 'D';
416 ndoors--; 402 --ndoors;
417 } 403 }
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 } 404 }
424
425 sfree (doorlist_x, w * h);
426 sfree (doorlist_y, w * h);
427} 405}
428 406
429/* takes a map and makes it symmetric: adjusts Xsize and 407/* takes a map and makes it symmetric: adjusts Xsize and
430 * Ysize to produce a symmetric map. 408 * Ysize to produce a symmetric map.
431 */ 409 */
489//-GPL 467//-GPL
490 468
491void 469void
492layout::rotate (int rotation) 470layout::rotate (int rotation)
493{ 471{
472 coroapi::cede_to_tick ();
473
494 switch (rotation & 3) 474 switch (rotation & 3)
495 { 475 {
496 case 2: /* a reflection */ 476 case 2: /* a reflection */
497 { 477 {
498 layout new_layout (w, h); 478 layout new_layout (w, h);
650{ 630{
651 layout new_layout (w * 2 - 1, h * 2 - 1); 631 layout new_layout (w * 2 - 1, h * 2 - 1);
652 632
653 new_layout.clear (); 633 new_layout.clear ();
654 634
635 coroapi::cede_to_tick ();
636
655 for (int i = 0; i < w; i++) 637 for (int i = 0; i < w; i++)
656 for (int j = 0; j < h; j++) 638 for (int j = 0; j < h; j++)
657 switch (data [i][j]) 639 switch (data [i][j])
658 { 640 {
659 case '#': expand_wall (new_layout, i, j, *this); break; 641 case '#': expand_wall (new_layout, i, j, *this); break;
741 723
742 return -1; 724 return -1;
743} 725}
744 726
745int 727int
746make_wall (char **maze, int x, int y, int dir) 728make_wall (layout &maze, int x, int y, int dir)
747{ 729{
748 maze[x][y] = 'D'; /* mark a door */ 730 maze[x][y] = 'D'; /* mark a door */
749 731
750 switch (dir) 732 switch (dir)
751 { 733 {
768 750
769void 751void
770layout::roomify () 752layout::roomify ()
771{ 753{
772 int tries = w * h / 30; 754 int tries = w * h / 30;
755
756 coroapi::cede_to_tick ();
773 757
774 for (int ti = 0; ti < tries; ti++) 758 for (int ti = 0; ti < tries; ti++)
775 { 759 {
776 /* starting location for looking at creating a door */ 760 /* starting location for looking at creating a door */
777 int dx = rmg_rndm (w); 761 int dx = rmg_rndm (w);
800 else 784 else
801 make_wall (*this, dx, dy, 1); 785 make_wall (*this, dx, dy, 1);
802 } 786 }
803} 787}
804 788
789//-GPL
790
805///////////////////////////////////////////////////////////////////////////// 791/////////////////////////////////////////////////////////////////////////////
792
793// inspired mostly by http://www.jimrandomh.org/misc/caves.txt
794void
795layout::gen_cave (int subtype)
796{
797 switch (subtype)
798 {
799 // a rough cave
800 case 0:
801 fill_rand (rmg_rndm (85, 97));
802 break;
803
804 // corridors
805 case 1:
806 fill_rand (rmg_rndm (5, 40));
807 erode_1_2 (5, 2, 10);
808 erode_1_2 (5, -1, 10);
809 erode_1_2 (5, 2, 1);
810 break;
811
812 // somewhat open, some room-like structures
813 case 2:
814 fill_rand (45);
815 erode_1_2 (5, 2, 4);
816 erode_1_2 (5, -1, 3);
817 break;
818
819 // wide open, roundish
820 case 3:
821 fill_rand (45);
822 erode_1_2 (5, 0, 5);
823 erode_1_2 (5, 1, 1);
824 break;
825 }
826
827 border ();
828 isolation_remover (1);
829}
830
831void
832layout::gen_castle ()
833{
834 fill ('#');
835
836 for (int n = w * h / 30 + 1; n--; )
837 {
838 int rw = rmg_rndm (6, 10);
839 int rh = rmg_rndm (6, 10);
840
841 if (rw > w || rh > h)
842 continue;
843
844 int rx = rmg_rndm (0, w - rw);
845 int ry = rmg_rndm (0, h - rh);
846
847 rect (rx, ry, rx + rw, ry + rh, '#');
848 fill_rect (rx + 1, ry + 1, rx + rw - 1, ry + rh - 1, 0);
849 }
850
851 border ();
852 isolation_remover (0);
853}
854
855static void
856gen_mixed_ (layout &maze, random_map_params *RP)
857{
858 if (maze.w > maze.h && maze.w > 16)
859 {
860 int m = rmg_rndm (8, maze.w - 8);
861
862 layout m1 (maze, 0, 0, m , maze.h); gen_mixed_ (m1, RP);
863 layout m2 (maze, m, 0, maze.w, maze.h); gen_mixed_ (m2, RP);
864 }
865 else if (maze.h > 16)
866 {
867 int m = rmg_rndm (8, maze.h - 8);
868
869 layout m1 (maze, 0, 0, maze.w, m ); gen_mixed_ (m1, RP);
870 layout m2 (maze, 0, m, maze.w, maze.h); gen_mixed_ (m2, RP);
871 }
872 else
873 {
874 RP->map_layout_style = rmg_rndm (NROFLAYOUTS - 2) + 1;
875
876 if (RP->map_layout_style == LAYOUT_MULTIPLE)
877 ++RP->map_layout_style;
878
879 maze.generate (RP);
880 }
881
882 coroapi::cede_to_tick ();
883}
884
885// recursive subdivision with random sublayouts
886static void
887gen_mixed (layout &maze, random_map_params *RP)
888{
889 random_map_params &rp = *new random_map_params (RP);
890 gen_mixed_ (maze, &rp);
891 delete &rp;
892
893 maze.border ();
894
895 // exits currently do not work so well, as they
896 // are currently often found together, so nuke entrances
897 maze.replace ('<', ' ');
898
899 maze.isolation_remover (0);
900}
901
902//+GPL
806 903
807/* function selects the maze function and gives it whatever 904/* function selects the maze function and gives it whatever
808 arguments it needs. */ 905 arguments it needs. */
809void 906void
810layout::generate (random_map_params *RP) 907layout::generate (random_map_params *RP)
870 if (rmg_rndm (2)) 967 if (rmg_rndm (2))
871 doorify (); 968 doorify ();
872 969
873 break; 970 break;
874 971
972 case LAYOUT_CASTLE:
973 gen_castle ();
974
975 if (rmg_rndm (2))
976 doorify ();
977
978 break;
979
980 case LAYOUT_MULTIPLE:
981 gen_mixed (*this, RP);
982 break;
983
875 default: 984 default:
876 abort (); 985 abort ();
877 } 986 }
987}
878 988
879 /* rotate the maze randomly */ 989//-GPL
880 rotate (rmg_rndm (4));
881
882 symmetrize (RP->symmetry_used);
883 990
884#if 0 991#if 0
885 print ();//D 992static void
886#endif 993gen_village (layout &maze)
994{
995 maze.clear ();
996 maze.border ();
887 997
888 if (RP->expand2x) 998 for (int n = maze.w * maze.h / 200 + 1; n--; )
889 expand2x (); 999 {
890} 1000 int rw = rmg_rndm (6, 10);
1001 int rh = rmg_rndm (6, 10);
891 1002
892//-GPL 1003 int rx = rmg_rndm (2, maze.w - rw - 2);
1004 int ry = rmg_rndm (2, maze.h - rh - 2);
893 1005
894#if 0 1006 maze.rect (rx, ry, rx + rw, ry + rh, '#');
1007 }
1008
1009 maze.border ();
1010 maze.isolation_remover (2);
1011}
1012
895static struct demo 1013static struct demo
896{ 1014{
897 demo () 1015 demo ()
898 { 1016 {
899 rmg_rndm.seed (time (0)); 1017 rmg_rndm.seed (time (0));
1018 extern void hack();hack ();
900 1019
901 for(int i=1;i<100;i++) 1020 for(int i=1;i<100;i++)
902 { 1021 {
903 layout maze (40, 25); 1022 layout maze (40, 30);
904 maze.fill_rand (85); 1023 maze.fill_rand (99);
905 maze.border (); 1024 maze.border ();
906 maze.isolation_remover (); 1025 maze.isolation_remover (2);
907 maze.print (); 1026 maze.print ();
908 } 1027 }
909 1028
910 exit (1); 1029 exit (1);
911 } 1030 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines