Knowledge

User:Dllu/Maze

Source 📝

3944: 3961:
Unfortunately that friend didn't follow my instructions on submitting the project and got marks taken off for not compiling. Also, the code for that project is excessively verbose because the project requirements included a minimum number of lines of code. It is also very, very slow because of the same reason as I mentioned earlier about choosing cells in Prim's algorithm. So I'm too embarrassed to upload the source code for those.
3969: 3987: 3914: 3897: 3960:
generated by the above algorithm. Instead, they were made by a variant of Prim's algorithm with many starting points simultaneously. The multiple regions thus created are then linked together at different places. I made that older algorithm when I was 16 for my friend's computer science project.
110:
This maze generator is somewhat unique in that it has a one layer "padding" of cells that are already marked as being in the maze even though they're not part of the maze. The reason for this is that when growing the maze, I don't have to separately check if we have reached the boundary.
3919: 3918: 3915: 3902: 3901: 3898: 3920: 3903: 3917: 3900: 106:
since it calls rand() something on the order of O(n) times. I was too lazy to do that using more efficient means since this started out as a program that only uses backtracking. Backtracking is very fast, however.
102:. The maze generator "grows" the maze until the counter for the number of "in" cells reaches the maximum possible. Note that my implementation of random cell selection in Prim's algorithm is 3916: 3899: 61:. Be aware that the page may be outdated and that the user in whose space this page is located may have no personal affiliation with any site other than 3936:
which is so large (and has to be viewed at full size) that it makes no sense to view it as a thumbnail. The solution for that is
47:
This is not an encyclopedia article or the talk page for an encyclopedia article. If you find this page on any site other than
3977: 645://The maze cells on the edges of the maze are "in" to provide padding. Otherwise, all maze cells are not in. 118: 58: 924://start growing from the corner. It could theoretically start growing from anywhere, doesn't matter. 3937: 114:
If you have any comments or suggestions for improvement, please post it in the Discussion page!
3933: 41: 8: 95: 99: 3990:
There are two solutions because I screwed up in connecting the different maze regions.
3972:
Click on it twice to see the animation. It seems that Knowledge's current version of
201://#define movie //this option spams bitmaps to illustrate each step of generation. 91: 732://All maze cells have all walls existing by default, except the perimeter cells. 198://enable this to generate mazes using depth-first search. Don't enable both. 189://generate a maze without any dead ends! (consequently, many solutions to maze) 3947:
40x20 maze without any dead ends. Many solutions exist between any two points.
3943: 192://#define prim //enable this to generate mazes using prim's algorithm. 3973: 1050://If at a dead end, randomly destroy a wall to make it not a dead end! 17: 2388://save a bitmap file! the xspecial, yspecial pixel is coloured red. 2283://Every iteration of this loop, one maze cell is added to the maze. 3968: 177:#define WHITE fprintf(outfile, "%c%c%c", 255,255,255) 363://The coordinates of the previous cell, used for backtracking. 3765:// See above - BMP lines must be of lengths divisible by 4. 183:#define RED fprintf(outfile, "%c%c%c", 0,0,255) 180:#define BLACK fprintf(outfile, "%c%c%c", 0,0,0) 72: 3986: 129://Released under the CC-BY-SA 3.0 License and the GFDL 1506://If all the neighbourhood cells are in, backtrack. 414://seed random number generator with system time 345://Does the wall to the left of this cell exist? 3887: 1575://randomly find a cell that's in the maze 126://Purpy Pupple's amazing maze generator. 3985: 3967: 3942: 3912: 3895: 14: 333://Does the wall above this cell exist? 3978:does not make GIF thumbnails properly 3907:30x20 "backtracking" maze generation. 3294://Actual writing of data begins here: 1731://Randomly grow the maze if possible. 94:! This code is capable of both using 25: 70:. The original page is located at 23: 24: 4004: 174:#define OUTFILE "MAZE" 3951: 219://Number of cells in the maze. 13: 1: 3924:30x20 "prim" maze generation. 67:pedia 53:pedia 38:pedia 2568:"%s_%dx%d_n%d.bmp" 7: 3934:this extreme 2000x2000 maze 3888:Demonstration of capability 321://Is this cell in the maze? 10: 4009: 123: 90:Here is some C code for 3956:These mazes below were 64:Wiki 50:Wiki 35:Wiki 3991: 3981: 3948: 3925: 3908: 3846:"file printed: %s 558://Initialize the maze! 119:Scroll down for videos 3989: 3971: 3946: 3923: 3906: 423://initialize the maze 507://output the bitmap 432://generate the maze 3992: 3982: 3949: 3926: 3909: 100:depth-first search 57:you are viewing a 3996: 3995: 3932:I also generated 3930: 3929: 3921: 3904: 195:#define backtrack 186:#define nodeadend 168:#define RIGHT 3 162:#define LEFT 2 156:#define DOWN 1 150:#define UP 0 88: 87: 80:ki/User:Dllu/Maze 4000: 3964: 3963: 3922: 3905: 3892: 3891: 3883: 3880: 3877: 3874: 3871: 3868: 3865: 3862: 3859: 3856: 3853: 3850: 3847: 3844: 3841: 3838: 3835: 3832: 3829: 3826: 3823: 3820: 3817: 3814: 3811: 3808: 3805: 3802: 3799: 3796: 3793: 3790: 3787: 3784: 3781: 3778: 3775: 3772: 3769: 3766: 3763: 3760: 3757: 3754: 3751: 3748: 3745: 3742: 3739: 3736: 3733: 3730: 3727: 3724: 3721: 3718: 3715: 3712: 3709: 3706: 3703: 3700: 3697: 3694: 3691: 3688: 3685: 3682: 3679: 3676: 3673: 3670: 3667: 3664: 3661: 3658: 3655: 3652: 3649: 3646: 3643: 3640: 3637: 3634: 3631: 3628: 3625: 3622: 3619: 3616: 3613: 3610: 3607: 3604: 3601: 3598: 3595: 3592: 3589: 3586: 3583: 3580: 3577: 3574: 3571: 3568: 3565: 3562: 3559: 3556: 3553: 3550: 3547: 3544: 3541: 3538: 3535: 3532: 3529: 3526: 3523: 3520: 3517: 3514: 3511: 3508: 3505: 3502: 3499: 3496: 3493: 3490: 3487: 3484: 3481: 3478: 3475: 3472: 3469: 3466: 3463: 3460: 3457: 3454: 3451: 3448: 3445: 3442: 3439: 3436: 3433: 3430: 3427: 3424: 3421: 3418: 3415: 3412: 3409: 3406: 3403: 3400: 3397: 3394: 3391: 3388: 3385: 3382: 3379: 3376: 3373: 3370: 3367: 3364: 3361: 3358: 3355: 3352: 3349: 3346: 3343: 3340: 3337: 3334: 3331: 3328: 3325: 3322: 3319: 3316: 3313: 3310: 3307: 3304: 3301: 3298: 3295: 3292: 3289: 3286: 3283: 3280: 3277: 3274: 3271: 3268: 3265: 3262: 3259: 3256: 3253: 3250: 3247: 3244: 3241: 3238: 3235: 3232: 3229: 3226: 3223: 3220: 3217: 3214: 3211: 3208: 3205: 3202: 3199: 3196: 3193: 3190: 3187: 3184: 3181: 3178: 3175: 3172: 3169: 3166: 3163: 3160: 3157: 3154: 3151: 3148: 3145: 3142: 3139: 3136: 3133: 3130: 3127: 3124: 3121: 3118: 3115: 3112: 3109: 3106: 3103: 3100: 3097: 3094: 3091: 3088: 3085: 3082: 3079: 3076: 3073: 3070: 3067: 3064: 3061: 3058: 3055: 3052: 3049: 3046: 3043: 3040: 3037: 3034: 3031: 3028: 3025: 3022: 3019: 3016: 3013: 3010: 3007: 3004: 3001: 2998: 2995: 2992: 2989: 2986: 2983: 2980: 2977: 2974: 2971: 2968: 2965: 2962: 2959: 2956: 2953: 2950: 2947: 2944: 2941: 2938: 2935: 2932: 2929: 2926: 2923: 2920: 2917: 2914: 2911: 2908: 2905: 2902: 2899: 2896: 2893: 2890: 2887: 2884: 2881: 2878: 2875: 2872: 2869: 2866: 2863: 2860: 2857: 2854: 2851: 2848: 2845: 2842: 2839: 2836: 2833: 2830: 2827: 2824: 2821: 2818: 2815: 2812: 2809: 2806: 2803: 2800: 2797: 2794: 2791: 2788: 2785: 2782: 2779: 2776: 2773: 2770: 2767: 2764: 2761: 2758: 2755: 2752: 2749: 2746: 2743: 2740: 2737: 2734: 2731: 2728: 2725: 2722: 2719: 2716: 2713: 2710: 2707: 2704: 2701: 2698: 2695: 2692: 2689: 2686: 2683: 2680: 2677: 2674: 2671: 2668: 2665: 2662: 2659: 2656: 2653: 2650: 2647: 2644: 2641: 2638: 2635: 2632: 2629: 2626: 2623: 2620: 2617: 2614: 2611: 2608: 2605: 2602: 2599: 2596: 2593: 2590: 2587: 2584: 2581: 2578: 2575: 2572: 2569: 2566: 2563: 2560: 2557: 2554: 2551: 2548: 2545: 2542: 2539: 2536: 2533: 2530: 2527: 2524: 2521: 2518: 2515: 2512: 2509: 2506: 2503: 2500: 2497: 2494: 2491: 2488: 2485: 2482: 2479: 2476: 2473: 2470: 2467: 2464: 2461: 2458: 2455: 2452: 2449: 2446: 2443: 2440: 2437: 2434: 2431: 2428: 2425: 2422: 2419: 2416: 2413: 2410: 2407: 2404: 2401: 2398: 2395: 2392: 2389: 2386: 2383: 2380: 2377: 2374: 2371: 2368: 2365: 2362: 2359: 2356: 2353: 2350: 2347: 2344: 2341: 2338: 2335: 2332: 2329: 2326: 2323: 2320: 2317: 2314: 2311: 2308: 2305: 2302: 2299: 2296: 2293: 2290: 2287: 2284: 2281: 2278: 2275: 2272: 2269: 2266: 2263: 2260: 2257: 2254: 2251: 2248: 2245: 2242: 2239: 2236: 2233: 2230: 2227: 2224: 2221: 2218: 2215: 2212: 2209: 2206: 2203: 2200: 2197: 2194: 2191: 2188: 2185: 2182: 2179: 2176: 2173: 2170: 2167: 2164: 2161: 2158: 2155: 2152: 2149: 2146: 2143: 2140: 2137: 2134: 2131: 2128: 2125: 2122: 2119: 2116: 2113: 2110: 2107: 2104: 2101: 2098: 2095: 2092: 2089: 2086: 2083: 2080: 2077: 2074: 2071: 2068: 2065: 2062: 2059: 2056: 2053: 2050: 2047: 2044: 2041: 2038: 2035: 2032: 2029: 2026: 2023: 2020: 2017: 2014: 2011: 2008: 2005: 2002: 1999: 1996: 1993: 1990: 1987: 1984: 1981: 1978: 1975: 1972: 1969: 1966: 1963: 1960: 1957: 1954: 1951: 1948: 1945: 1942: 1939: 1936: 1933: 1930: 1927: 1924: 1921: 1918: 1915: 1912: 1909: 1906: 1903: 1900: 1897: 1894: 1891: 1888: 1885: 1882: 1879: 1876: 1873: 1870: 1867: 1864: 1861: 1858: 1855: 1852: 1849: 1846: 1843: 1840: 1837: 1834: 1831: 1828: 1825: 1822: 1819: 1816: 1813: 1810: 1807: 1804: 1801: 1798: 1795: 1792: 1789: 1786: 1783: 1780: 1777: 1774: 1771: 1768: 1765: 1762: 1759: 1756: 1753: 1750: 1747: 1744: 1741: 1738: 1735: 1732: 1729: 1726: 1723: 1720: 1717: 1714: 1711: 1708: 1705: 1702: 1699: 1696: 1693: 1690: 1687: 1684: 1681: 1678: 1675: 1672: 1669: 1666: 1663: 1660: 1657: 1654: 1651: 1648: 1645: 1642: 1639: 1636: 1633: 1630: 1627: 1624: 1621: 1618: 1615: 1612: 1609: 1606: 1603: 1600: 1597: 1594: 1591: 1588: 1585: 1582: 1579: 1576: 1573: 1570: 1567: 1564: 1561: 1558: 1555: 1552: 1549: 1546: 1543: 1540: 1537: 1534: 1531: 1528: 1525: 1522: 1519: 1516: 1513: 1510: 1507: 1504: 1501: 1498: 1495: 1492: 1489: 1486: 1483: 1480: 1477: 1474: 1471: 1468: 1465: 1462: 1459: 1456: 1453: 1450: 1449:#ifdef backtrack 1447: 1444: 1441: 1438: 1435: 1432: 1429: 1426: 1423: 1420: 1417: 1414: 1411: 1408: 1405: 1402: 1399: 1396: 1393: 1390: 1387: 1384: 1381: 1378: 1375: 1372: 1369: 1366: 1363: 1360: 1357: 1354: 1351: 1348: 1345: 1342: 1339: 1336: 1333: 1330: 1327: 1324: 1321: 1318: 1315: 1312: 1309: 1306: 1303: 1300: 1297: 1294: 1291: 1288: 1285: 1282: 1279: 1276: 1273: 1270: 1267: 1264: 1261: 1258: 1255: 1252: 1249: 1246: 1243: 1240: 1237: 1234: 1231: 1228: 1225: 1222: 1219: 1216: 1213: 1210: 1207: 1204: 1201: 1198: 1195: 1192: 1189: 1186: 1183: 1180: 1177: 1174: 1171: 1168: 1165: 1162: 1159: 1156: 1153: 1150: 1147: 1144: 1141: 1138: 1135: 1132: 1129: 1126: 1123: 1120: 1117: 1114: 1111: 1108: 1105: 1102: 1099: 1096: 1093: 1090: 1087: 1084: 1081: 1078: 1075: 1072: 1069: 1066: 1063: 1060: 1057: 1054: 1051: 1048: 1045: 1042: 1039: 1036: 1033: 1030: 1027: 1024: 1021: 1018: 1015: 1012: 1009: 1006: 1003: 1000: 997: 994: 993:#ifdef nodeadend 991: 988: 985: 982: 979: 976: 973: 970: 967: 964: 961: 958: 955: 952: 949: 946: 943: 940: 937: 934: 931: 928: 925: 922: 919: 916: 913: 910: 907: 904: 901: 898: 895: 892: 889: 886: 883: 880: 877: 874: 871: 868: 865: 862: 859: 856: 853: 850: 847: 844: 841: 838: 835: 832: 829: 826: 823: 820: 817: 814: 811: 808: 805: 802: 799: 796: 793: 790: 787: 784: 781: 778: 775: 772: 769: 766: 763: 760: 757: 754: 751: 748: 745: 742: 739: 736: 733: 730: 727: 724: 721: 718: 715: 712: 709: 706: 703: 700: 697: 694: 691: 688: 685: 682: 679: 676: 673: 670: 667: 664: 661: 658: 655: 652: 649: 646: 643: 640: 637: 634: 631: 628: 625: 622: 619: 616: 613: 610: 607: 604: 601: 598: 595: 592: 589: 586: 583: 580: 577: 574: 571: 568: 565: 562: 559: 556: 553: 550: 547: 544: 541: 538: 535: 532: 529: 526: 523: 520: 517: 514: 511: 508: 505: 502: 499: 496: 493: 490: 487: 484: 481: 478: 475: 472: 469: 466: 463: 460: 457: 454: 451: 448: 445: 442: 439: 436: 433: 430: 427: 424: 421: 418: 415: 412: 409: 406: 403: 400: 397: 394: 391: 388: 385: 382: 379: 376: 373: 370: 367: 364: 361: 358: 355: 352: 349: 346: 343: 340: 337: 334: 331: 328: 325: 322: 319: 316: 313: 310: 307: 304: 301: 298: 295: 292: 289: 286: 283: 280: 277: 274: 271: 268: 265: 262: 259: 256: 253: 250: 247: 244: 241: 238: 235: 232: 229: 226: 223: 220: 217: 214: 211: 208: 205: 202: 199: 196: 193: 190: 187: 184: 181: 178: 175: 172: 169: 166: 163: 160: 157: 154: 151: 148: 145: 142: 141:<stdlib.h> 139: 136: 133: 130: 127: 96:Prim's algorithm 92:generating mazes 84: 81: 78: 75: 69: 68: 65: 56: 54: 51: 40: 39: 36: 26: 4008: 4007: 4003: 4002: 4001: 3999: 3998: 3997: 3954: 3913: 3896: 3890: 3885: 3884: 3881: 3878: 3875: 3872: 3869: 3866: 3863: 3860: 3857: 3854: 3851: 3848: 3845: 3842: 3839: 3836: 3833: 3830: 3827: 3824: 3821: 3818: 3815: 3812: 3809: 3806: 3803: 3800: 3797: 3794: 3791: 3788: 3785: 3782: 3779: 3776: 3773: 3770: 3767: 3764: 3761: 3758: 3755: 3752: 3749: 3746: 3743: 3740: 3737: 3734: 3731: 3728: 3725: 3722: 3719: 3716: 3713: 3710: 3707: 3704: 3701: 3698: 3695: 3692: 3689: 3686: 3683: 3680: 3677: 3674: 3671: 3668: 3665: 3662: 3659: 3656: 3653: 3650: 3647: 3644: 3641: 3638: 3635: 3632: 3629: 3626: 3623: 3620: 3617: 3614: 3611: 3608: 3605: 3602: 3599: 3596: 3593: 3590: 3587: 3584: 3581: 3578: 3575: 3572: 3569: 3566: 3563: 3560: 3557: 3554: 3551: 3548: 3545: 3542: 3539: 3536: 3533: 3530: 3527: 3524: 3521: 3518: 3515: 3512: 3509: 3506: 3503: 3500: 3497: 3494: 3491: 3488: 3485: 3482: 3479: 3476: 3473: 3470: 3467: 3464: 3461: 3458: 3455: 3452: 3449: 3446: 3443: 3440: 3437: 3434: 3431: 3428: 3425: 3422: 3419: 3416: 3413: 3410: 3407: 3404: 3401: 3398: 3395: 3392: 3389: 3386: 3383: 3380: 3377: 3374: 3371: 3368: 3365: 3362: 3359: 3356: 3353: 3350: 3347: 3344: 3341: 3338: 3335: 3332: 3329: 3326: 3323: 3320: 3317: 3314: 3311: 3308: 3305: 3302: 3299: 3296: 3293: 3290: 3287: 3284: 3281: 3278: 3275: 3272: 3269: 3266: 3263: 3260: 3257: 3254: 3251: 3248: 3245: 3242: 3239: 3236: 3233: 3230: 3227: 3224: 3221: 3218: 3215: 3212: 3209: 3206: 3203: 3200: 3197: 3194: 3191: 3188: 3185: 3182: 3179: 3176: 3173: 3170: 3167: 3164: 3161: 3158: 3155: 3152: 3149: 3146: 3143: 3140: 3137: 3134: 3131: 3128: 3125: 3122: 3119: 3116: 3113: 3110: 3107: 3104: 3101: 3098: 3095: 3092: 3089: 3086: 3083: 3080: 3077: 3074: 3071: 3068: 3065: 3062: 3059: 3056: 3053: 3050: 3047: 3044: 3041: 3038: 3035: 3032: 3029: 3026: 3023: 3020: 3017: 3014: 3011: 3008: 3005: 3002: 2999: 2996: 2993: 2990: 2987: 2984: 2981: 2978: 2975: 2972: 2969: 2966: 2963: 2960: 2957: 2954: 2951: 2948: 2945: 2942: 2939: 2936: 2933: 2930: 2927: 2924: 2921: 2918: 2915: 2912: 2909: 2906: 2903: 2900: 2897: 2894: 2891: 2888: 2885: 2882: 2879: 2876: 2873: 2870: 2867: 2864: 2861: 2858: 2855: 2852: 2849: 2846: 2843: 2840: 2837: 2834: 2831: 2828: 2825: 2822: 2819: 2816: 2813: 2810: 2807: 2804: 2801: 2798: 2795: 2792: 2789: 2786: 2783: 2780: 2777: 2774: 2771: 2768: 2765: 2762: 2759: 2756: 2753: 2750: 2747: 2744: 2741: 2738: 2735: 2732: 2729: 2726: 2723: 2720: 2717: 2714: 2711: 2708: 2705: 2702: 2699: 2696: 2693: 2690: 2687: 2684: 2681: 2678: 2675: 2672: 2669: 2666: 2663: 2660: 2657: 2654: 2651: 2648: 2645: 2642: 2639: 2636: 2633: 2630: 2627: 2624: 2621: 2618: 2615: 2612: 2609: 2606: 2603: 2600: 2597: 2594: 2591: 2588: 2585: 2582: 2579: 2576: 2573: 2570: 2567: 2564: 2561: 2558: 2555: 2552: 2549: 2546: 2543: 2540: 2537: 2534: 2531: 2528: 2525: 2522: 2519: 2516: 2513: 2510: 2507: 2504: 2501: 2498: 2495: 2492: 2489: 2486: 2483: 2480: 2477: 2474: 2471: 2468: 2465: 2462: 2459: 2456: 2453: 2450: 2447: 2444: 2441: 2438: 2435: 2432: 2429: 2426: 2423: 2420: 2417: 2414: 2411: 2408: 2405: 2402: 2399: 2396: 2393: 2390: 2387: 2384: 2381: 2378: 2375: 2372: 2369: 2366: 2363: 2360: 2357: 2354: 2351: 2348: 2345: 2342: 2339: 2336: 2333: 2330: 2327: 2324: 2321: 2318: 2315: 2312: 2309: 2306: 2303: 2300: 2297: 2294: 2291: 2288: 2285: 2282: 2279: 2276: 2273: 2270: 2267: 2264: 2261: 2258: 2255: 2252: 2249: 2246: 2243: 2240: 2237: 2234: 2231: 2228: 2225: 2222: 2219: 2216: 2213: 2210: 2207: 2204: 2201: 2198: 2195: 2192: 2189: 2186: 2183: 2180: 2177: 2174: 2171: 2168: 2165: 2162: 2159: 2156: 2153: 2150: 2147: 2144: 2141: 2138: 2135: 2132: 2129: 2126: 2123: 2120: 2117: 2114: 2111: 2108: 2105: 2102: 2099: 2096: 2093: 2090: 2087: 2084: 2081: 2078: 2075: 2072: 2069: 2066: 2063: 2060: 2057: 2054: 2051: 2048: 2045: 2042: 2039: 2036: 2033: 2030: 2027: 2024: 2021: 2018: 2015: 2012: 2009: 2006: 2003: 2000: 1997: 1994: 1991: 1988: 1985: 1982: 1979: 1976: 1973: 1970: 1967: 1964: 1961: 1958: 1955: 1952: 1949: 1946: 1943: 1940: 1937: 1934: 1931: 1928: 1925: 1922: 1919: 1916: 1913: 1910: 1907: 1904: 1901: 1898: 1895: 1892: 1889: 1886: 1883: 1880: 1877: 1874: 1871: 1868: 1865: 1862: 1859: 1856: 1853: 1850: 1847: 1844: 1841: 1838: 1835: 1832: 1829: 1826: 1823: 1820: 1817: 1814: 1811: 1808: 1805: 1802: 1799: 1796: 1793: 1790: 1787: 1784: 1781: 1778: 1775: 1772: 1769: 1766: 1763: 1760: 1757: 1754: 1751: 1748: 1745: 1742: 1739: 1736: 1733: 1730: 1727: 1724: 1721: 1718: 1715: 1712: 1709: 1706: 1703: 1700: 1697: 1694: 1691: 1688: 1685: 1682: 1679: 1676: 1673: 1670: 1667: 1664: 1661: 1658: 1655: 1652: 1649: 1646: 1643: 1640: 1637: 1634: 1631: 1628: 1625: 1622: 1619: 1616: 1613: 1610: 1607: 1604: 1601: 1598: 1595: 1592: 1589: 1586: 1583: 1580: 1577: 1574: 1571: 1568: 1565: 1562: 1559: 1556: 1553: 1550: 1547: 1544: 1541: 1538: 1535: 1532: 1529: 1526: 1523: 1520: 1517: 1514: 1511: 1508: 1505: 1502: 1499: 1496: 1493: 1490: 1487: 1484: 1481: 1478: 1475: 1472: 1469: 1466: 1463: 1460: 1457: 1454: 1451: 1448: 1445: 1442: 1439: 1436: 1433: 1430: 1427: 1424: 1421: 1418: 1415: 1412: 1409: 1406: 1403: 1400: 1397: 1394: 1391: 1388: 1385: 1382: 1379: 1376: 1373: 1370: 1367: 1364: 1361: 1358: 1355: 1352: 1349: 1346: 1343: 1340: 1337: 1334: 1331: 1328: 1325: 1322: 1319: 1316: 1313: 1310: 1307: 1304: 1301: 1298: 1295: 1292: 1289: 1286: 1283: 1280: 1277: 1274: 1271: 1268: 1265: 1262: 1259: 1256: 1253: 1250: 1247: 1244: 1241: 1238: 1235: 1232: 1229: 1226: 1223: 1220: 1217: 1214: 1211: 1208: 1205: 1202: 1199: 1196: 1193: 1190: 1187: 1184: 1181: 1178: 1175: 1172: 1169: 1166: 1163: 1160: 1157: 1154: 1151: 1148: 1145: 1142: 1139: 1136: 1133: 1130: 1127: 1124: 1121: 1118: 1115: 1112: 1109: 1106: 1103: 1100: 1097: 1094: 1091: 1088: 1085: 1082: 1079: 1076: 1073: 1070: 1067: 1064: 1061: 1058: 1055: 1052: 1049: 1046: 1043: 1040: 1037: 1034: 1031: 1028: 1025: 1022: 1019: 1016: 1013: 1010: 1007: 1004: 1001: 998: 995: 992: 989: 986: 983: 980: 977: 974: 971: 968: 965: 962: 959: 956: 953: 950: 947: 944: 941: 938: 935: 932: 929: 926: 923: 920: 917: 914: 911: 908: 905: 902: 899: 896: 893: 890: 887: 884: 881: 878: 875: 872: 869: 866: 863: 860: 857: 854: 851: 848: 845: 842: 839: 836: 833: 830: 827: 824: 821: 818: 815: 812: 809: 806: 803: 800: 797: 794: 791: 788: 785: 782: 779: 776: 773: 770: 767: 764: 761: 758: 755: 752: 749: 746: 743: 740: 737: 734: 731: 728: 725: 722: 719: 716: 713: 710: 707: 704: 701: 698: 695: 692: 689: 686: 683: 680: 677: 674: 671: 668: 665: 662: 659: 656: 653: 650: 647: 644: 641: 638: 635: 632: 629: 626: 623: 620: 617: 614: 611: 608: 605: 602: 599: 596: 593: 590: 587: 584: 581: 578: 575: 572: 569: 566: 563: 560: 557: 554: 551: 548: 545: 542: 539: 536: 533: 530: 527: 524: 521: 518: 515: 512: 509: 506: 503: 500: 497: 494: 491: 488: 485: 482: 479: 476: 473: 470: 467: 464: 461: 458: 455: 452: 449: 446: 443: 440: 437: 434: 431: 428: 425: 422: 419: 416: 413: 410: 407: 404: 401: 398: 395: 392: 389: 386: 383: 380: 377: 374: 371: 368: 365: 362: 359: 356: 353: 350: 347: 344: 341: 338: 335: 332: 329: 326: 323: 320: 317: 314: 311: 308: 305: 302: 299: 296: 293: 290: 287: 284: 281: 278: 275: 272: 269: 266: 263: 260: 257: 254: 251: 248: 245: 242: 239: 236: 233: 230: 227: 224: 221: 218: 215: 212: 209: 206: 203: 200: 197: 194: 191: 188: 185: 182: 179: 176: 173: 170: 167: 164: 161: 158: 155: 152: 149: 146: 143: 140: 137: 135:<stdio.h> 134: 131: 128: 125: 79: 76: 74:https://en.wiki 73: 71: 66: 63: 62: 52: 49: 48: 46: 37: 34: 33: 22: 21: 20: 12: 11: 5: 4006: 3994: 3993: 3983: 3953: 3950: 3928: 3927: 3910: 3889: 3886: 3819:"%c" 3249:"%c" 3207:"%c" 3165:"%c" 3135:"%c" 3072:"%c" 3048:"%c" 3024:"%c" 3000:"%c" 2943:"%c" 2901:"%c" 2859:"%c" 2829:"%c" 2772:"BM" 2754:"wb" 147:<time.h> 124: 104:extremely slow 86: 85: 29: 15: 9: 6: 4: 3: 2: 4005: 3988: 3984: 3979: 3975: 3970: 3966: 3965: 3962: 3959: 3945: 3941: 3939: 3935: 3911: 3894: 3893: 122: 121: 120: 115: 112: 108: 105: 101: 97: 93: 82: 60: 45: 43: 30: 28: 27: 19: 3957: 3955: 3931: 2328:#ifdef movie 969:#ifdef movie 435:#ifdef movie 117: 116: 113: 109: 103: 89: 77:pedia.org/wi 31: 3974:ImageMagick 3952:Other mazes 1566:#ifdef prim 513:#else movie 59:mirror site 3976:sometimes 3792:extrabytes 3759:extrabytes 3693:&& 3612:&& 3558:&& 3456:&& 3408:&& 3276:0xFF000000 3222:0x00FF0000 3180:0x0000FF00 3147:0x000000FF 2970:0xFF000000 2916:0x00FF0000 2874:0x0000FF00 2841:0x000000FF 2706:paddedsize 2652:paddedsize 2622:extrabytes 2598:paddedsize 2499:extrabytes 2412:paddedsize 2406:extrabytes 1707:&& 1695:&& 1683:&& 1491:&& 1479:&& 1467:&& 1365:&& 1287:&& 1206:&& 1128:&& 1035:&& 1023:&& 1011:&& 552:initialize 417:initialize 261:initialize 32:This is a 42:user page 18:User:Dllu 3858:filename 3477:yspecial 3453:xspecial 3282:>> 3267:unsigned 3228:>> 3186:>> 2976:>> 2961:unsigned 2922:>> 2880:>> 2748:filename 2637:unsigned 2562:filename 2550:filename 2382:yspecial 2373:xspecial 1773:whichway 1746:whichway 1098:whichway 1071:whichway 948:whichway 891:generate 426:generate 393:unsigned 297:yspecial 288:xspecial 270:generate 144:#include 138:#include 132:#include 3870:outfile 3813:outfile 3807:fprintf 3258:headers 3243:outfile 3237:fprintf 3216:headers 3201:outfile 3195:fprintf 3174:headers 3159:outfile 3153:fprintf 3141:headers 3129:outfile 3123:fprintf 3066:outfile 3060:fprintf 3042:outfile 3036:fprintf 3018:outfile 3012:fprintf 2994:outfile 2988:fprintf 2952:headers 2937:outfile 2931:fprintf 2910:headers 2895:outfile 2889:fprintf 2868:headers 2853:outfile 2847:fprintf 2835:headers 2823:outfile 2817:fprintf 2766:outfile 2760:fprintf 2736:outfile 2643:headers 2574:OUTFILE 2556:sprintf 2397:outfile 2364:savebmp 2331:savebmp 2250:success 2151:success 2037:success 1923:success 1809:success 1734:success 1437:success 1383:success 1302:success 1224:success 1143:success 1059:success 972:savebmp 957:success 516:savebmp 489:savebmp 279:savebmp 3876:return 3864:fclose 3852:" 3840:printf 3321:height 2688:height 2631:height 2472:height 2352:return 2349:#endif 1767:switch 1722:#endif 1563:#endif 1446:#endif 1092:switch 990:#endif 879:return 537:return 534:#endif 303:struct 3789:<= 3741:WHITE 3732:BLACK 3660:WHITE 3651:BLACK 3579:BLACK 3522:BLACK 3513:WHITE 3366:width 3363:<= 3318:<= 3261:& 3219:& 3177:& 3144:& 3105:<= 2955:& 2913:& 2871:& 2838:& 2799:<= 2742:fopen 2682:width 2607:width 2592:numin 2586:ysize 2580:xsize 2517:width 2481:ysize 2451:xsize 2442:width 2319:ysize 2304:xsize 2295:numin 2289:while 2274:numin 2241:while 2229:break 2205:prevy 2187:prevx 2124:RIGHT 2115:break 2091:prevy 2073:prevx 2001:break 1977:prevy 1959:prevx 1887:break 1863:prevy 1845:prevx 1653:while 1632:ysize 1596:xsize 1554:xcur2 1542:prevy 1524:prevx 1512:xcur2 1452:while 1428:while 1416:break 1374:xsize 1344:RIGHT 1335:break 1257:break 1215:ysize 1176:break 849:ysize 768:xsize 708:ysize 681:xsize 630:ysize 588:xsize 480:numin 387:srand 357:prevy 351:prevx 246:ysize 240:const 228:xsize 222:const 207:numin 16:< 3938:here 3738:else 3720:MAZE 3669:else 3657:else 3645:left 3639:MAZE 3588:else 3534:else 3519:else 3501:MAZE 3489:else 2547:char 2391:FILE 2361:void 2343:ycur 2337:xcur 2298:< 2256:MAZE 2217:xcur 2211:ycur 2199:MAZE 2193:xcur 2181:MAZE 2169:left 2163:MAZE 2139:MAZE 2121:case 2103:xcur 2097:ycur 2085:MAZE 2079:xcur 2067:MAZE 2055:left 2049:MAZE 2025:MAZE 2010:LEFT 2007:case 1989:ycur 1983:ycur 1971:MAZE 1965:xcur 1953:MAZE 1935:MAZE 1911:MAZE 1896:DOWN 1893:case 1875:ycur 1869:ycur 1857:MAZE 1851:xcur 1839:MAZE 1821:MAZE 1797:MAZE 1779:case 1752:rand 1710:MAZE 1698:MAZE 1686:MAZE 1674:MAZE 1662:MAZE 1620:rand 1614:ycur 1584:rand 1578:xcur 1548:xcur 1536:MAZE 1530:ycur 1518:MAZE 1494:MAZE 1482:MAZE 1470:MAZE 1458:MAZE 1401:left 1395:MAZE 1368:xcur 1362:left 1356:MAZE 1341:case 1320:left 1314:MAZE 1290:xcur 1284:left 1278:MAZE 1266:LEFT 1263:case 1236:MAZE 1209:ycur 1197:MAZE 1185:DOWN 1182:case 1155:MAZE 1131:ycur 1119:MAZE 1104:case 1077:rand 1038:MAZE 1026:MAZE 1014:MAZE 1002:MAZE 984:ycur 978:xcur 954:bool 927:MAZE 912:ycur 900:xcur 888:void 810:left 804:MAZE 735:MAZE 648:MAZE 627:< 585:< 549:void 462:< 408:NULL 402:time 381:main 372:MAZE 369:cell 339:left 336:bool 324:bool 312:bool 306:cell 276:void 267:void 258:void 204:long 171://+x 165://-x 159://+y 153://-y 98:and 3958:not 3768:for 3483:RED 3342:for 3297:for 3270:int 3084:for 2964:int 2778:for 2640:int 2493:2-1 2469:int 2463:2-1 2439:int 2418:int 2403:int 2379:int 2370:int 2325:)); 1509:int 945:int 897:int 894:(){ 609:int 603:for 567:int 561:for 555:(){ 444:int 438:for 429:(); 420:(); 411:)); 396:int 384:(){ 378:int 348:int 294:int 285:int 273:(); 264:(); 252:122 243:int 234:152 225:int 3940:. 3873:); 3861:); 3849:\n 3828:); 3804:){ 3801:++ 3762:){ 3753:if 3726:up 3714:if 3711:){ 3705:== 3687:== 3672:if 3633:if 3630:){ 3624:== 3606:== 3591:if 3576:){ 3570:== 3552:== 3537:if 3507:in 3495:if 3474:== 3450:== 3429:if 3426:){ 3420:== 3402:== 3387:if 3384:){ 3381:++ 3339:){ 3336:++ 3288:); 3285:24 3234:); 3231:16 3192:); 3150:); 3120:){ 3117:++ 3108:12 3081:); 3057:); 3054:24 3033:); 3009:); 2982:); 2979:24 2928:); 2925:16 2886:); 2844:); 2814:){ 2811:++ 2775:); 2757:); 2733:}; 2676:40 2670:54 2658:54 2604:(( 2595:); 2535:)) 2514:(( 2484:-1 2454:-1 2385:){ 2346:); 2322:-2 2307:-2 2277:++ 2262:in 2253:); 2220:++ 2148:){ 2145:in 2130:if 2106:-- 2034:){ 2031:in 2016:if 1992:++ 1941:up 1920:){ 1917:in 1902:if 1878:-- 1827:up 1806:){ 1803:in 1788:if 1782:UP 1776:){ 1755:() 1725:do 1719:); 1716:in 1704:in 1692:in 1680:in 1671:|| 1668:in 1635:-2 1623:() 1599:-2 1587:() 1569:do 1503:){ 1500:in 1488:in 1476:in 1464:in 1440:); 1380:){ 1377:-2 1371:!= 1350:if 1299:){ 1293:!= 1272:if 1242:up 1221:){ 1218:-2 1212:!= 1203:up 1191:if 1161:up 1140:){ 1134:!= 1125:up 1113:if 1107:UP 1101:){ 1080:() 1053:do 1047:){ 1044:in 1032:in 1020:in 1008:in 996:if 987:); 963:do 933:in 852:-1 846:== 840:|| 834:== 828:|| 822:== 780:== 774:|| 771:-1 765:== 759:|| 753:== 741:up 711:-1 705:== 699:|| 693:== 687:|| 684:-1 678:== 672:|| 666:== 654:in 642:){ 639:++ 600:){ 597:++ 531:); 504:); 483:++ 477:){ 474:++ 465:10 390:(( 366:}; 327:up 315:in 300:); 3980:. 3882:} 3879:; 3867:( 3855:, 3843:( 3837:} 3834:} 3831:} 3825:0 3822:, 3816:, 3810:( 3798:n 3795:; 3786:n 3783:; 3780:1 3777:= 3774:n 3771:( 3756:( 3750:} 3747:} 3744:; 3735:; 3729:) 3723:. 3717:( 3708:0 3702:2 3699:% 3696:y 3690:1 3684:2 3681:% 3678:x 3675:( 3666:} 3663:; 3654:; 3648:) 3642:. 3636:( 3627:1 3621:2 3618:% 3615:y 3609:0 3603:2 3600:% 3597:x 3594:( 3585:} 3582:; 3573:0 3567:2 3564:% 3561:y 3555:0 3549:2 3546:% 3543:x 3540:( 3531:} 3528:} 3525:; 3516:; 3510:) 3504:. 3498:( 3492:{ 3486:; 3480:) 3471:1 3468:+ 3465:2 3462:/ 3459:y 3447:1 3444:+ 3441:2 3438:/ 3435:x 3432:( 3423:1 3417:2 3414:% 3411:y 3405:1 3399:2 3396:% 3393:x 3390:( 3378:x 3375:; 3372:1 3369:- 3360:x 3357:; 3354:0 3351:= 3348:x 3345:( 3333:y 3330:; 3327:1 3324:- 3315:y 3312:; 3309:0 3306:= 3303:y 3300:( 3291:} 3279:) 3273:) 3264:( 3255:( 3252:, 3246:, 3240:( 3225:) 3213:( 3210:, 3204:, 3198:( 3189:8 3183:) 3171:( 3168:, 3162:, 3156:( 3138:, 3132:, 3126:( 3114:n 3111:; 3102:n 3099:; 3096:7 3093:= 3090:n 3087:( 3078:0 3075:, 3069:, 3063:( 3051:, 3045:, 3039:( 3030:0 3027:, 3021:, 3015:( 3006:1 3003:, 2997:, 2991:( 2985:} 2973:) 2967:) 2958:( 2949:( 2946:, 2940:, 2934:( 2919:) 2907:( 2904:, 2898:, 2892:( 2883:8 2877:) 2865:( 2862:, 2856:, 2850:( 2832:, 2826:, 2820:( 2808:n 2805:; 2802:5 2796:n 2793:; 2790:0 2787:= 2784:n 2781:( 2769:, 2763:( 2751:, 2745:( 2739:= 2730:0 2727:, 2724:0 2721:, 2718:0 2715:, 2712:0 2709:, 2703:, 2700:0 2697:, 2694:0 2691:, 2685:, 2679:, 2673:, 2667:, 2664:0 2661:, 2655:+ 2649:{ 2646:= 2634:; 2628:* 2625:) 2619:+ 2616:) 2613:3 2610:* 2601:= 2589:, 2583:, 2577:, 2571:, 2565:, 2559:( 2553:; 2544:; 2541:4 2538:% 2532:4 2529:% 2526:) 2523:3 2520:* 2511:- 2508:4 2505:( 2502:= 2496:; 2490:* 2487:) 2478:( 2475:= 2466:; 2460:* 2457:) 2448:( 2445:= 2436:; 2433:n 2430:, 2427:y 2424:, 2421:x 2415:; 2409:, 2400:; 2394:* 2376:, 2367:( 2358:} 2355:; 2340:, 2334:( 2316:( 2313:* 2310:) 2301:( 2292:( 2286:} 2280:; 2271:; 2268:1 2265:= 2259:. 2247:! 2244:( 2238:} 2235:} 2232:; 2226:} 2223:; 2214:; 2208:= 2202:. 2196:; 2190:= 2184:. 2178:; 2175:0 2172:= 2166:. 2160:; 2157:1 2154:= 2142:. 2136:! 2133:( 2127:: 2118:; 2112:} 2109:; 2100:; 2094:= 2088:. 2082:; 2076:= 2070:. 2064:; 2061:0 2058:= 2052:. 2046:; 2043:1 2040:= 2028:. 2022:! 2019:( 2013:: 2004:; 1998:} 1995:; 1986:; 1980:= 1974:. 1968:; 1962:= 1956:. 1950:; 1947:0 1944:= 1938:. 1932:; 1929:1 1926:= 1914:. 1908:! 1905:( 1899:: 1890:; 1884:} 1881:; 1872:; 1866:= 1860:. 1854:; 1848:= 1842:. 1836:; 1833:0 1830:= 1824:. 1818:; 1815:1 1812:= 1800:. 1794:! 1791:( 1785:: 1770:( 1764:; 1761:4 1758:% 1749:= 1743:; 1740:0 1737:= 1728:{ 1713:. 1701:. 1689:. 1677:. 1665:. 1659:! 1656:( 1650:} 1647:; 1644:1 1641:+ 1638:) 1629:( 1626:% 1617:= 1611:; 1608:1 1605:+ 1602:) 1593:( 1590:% 1581:= 1572:{ 1560:} 1557:; 1551:= 1545:; 1539:. 1533:= 1527:; 1521:. 1515:= 1497:. 1485:. 1473:. 1461:. 1455:( 1443:} 1434:! 1431:( 1425:} 1422:} 1419:; 1413:} 1410:; 1407:0 1404:= 1398:. 1392:; 1389:1 1386:= 1359:. 1353:( 1347:: 1338:; 1332:} 1329:; 1326:0 1323:= 1317:. 1311:; 1308:1 1305:= 1296:1 1281:. 1275:( 1269:: 1260:; 1254:} 1251:; 1248:0 1245:= 1239:. 1233:; 1230:1 1227:= 1200:. 1194:( 1188:: 1179:; 1173:} 1170:; 1167:0 1164:= 1158:. 1152:; 1149:1 1146:= 1137:1 1122:. 1116:( 1110:: 1095:( 1089:; 1086:4 1083:% 1074:= 1068:; 1065:0 1062:= 1056:{ 1041:. 1029:. 1017:. 1005:. 999:( 981:, 975:( 966:{ 960:; 951:; 942:; 939:1 936:= 930:. 921:; 918:1 915:= 909:, 906:1 903:= 885:} 882:; 876:} 873:} 870:; 867:1 864:: 861:0 858:? 855:) 843:y 837:0 831:y 825:0 819:x 816:( 813:= 807:. 801:; 798:1 795:: 792:0 789:? 786:) 783:0 777:y 762:x 756:0 750:x 747:( 744:= 738:. 729:; 726:0 723:: 720:1 717:? 714:) 702:y 696:0 690:y 675:x 669:0 663:x 660:( 657:= 651:. 636:y 633:; 624:y 621:; 618:0 615:= 612:y 606:( 594:x 591:; 582:x 579:; 576:0 573:= 570:x 564:( 546:} 543:; 540:0 528:0 525:, 522:0 519:( 510:} 501:0 498:, 495:0 492:( 486:; 471:i 468:; 459:i 456:; 453:1 450:= 447:i 441:( 405:( 399:) 375:; 360:; 354:, 342:; 330:; 318:; 309:{ 291:, 282:( 255:; 249:= 237:; 231:= 216:; 213:1 210:= 83:. 55:, 44:.

Index

User:Dllu
user page
mirror site
https://en.wikipedia.org/wiki/User:Dllu/Maze
generating mazes
Prim's algorithm
depth-first search
Scroll down for videos
this extreme 2000x2000 maze
here


ImageMagick
does not make GIF thumbnails properly

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.