Maze Generation Program

Discussion in 'Computer Science & Culture' started by Anton, Mar 3, 2002.

Thread Status:
Not open for further replies.
  1. Anton Registered Member

    Messages:
    8
    Hi guys...just a question for more experienced programmers and comp sci people. Ive read on the majority maze generation algorithm (both iterative and recursive) and find that they all work quite well. However, my question is I have not found one that is able to produce the following maze. Most of the algorithms ive found work by setting up a "cell" or room structure and knocking down walls til there is a "perfect" maze, with only one path. BUT..doing it this way means the array will always be 2w+1 wide with w being number of cells across and 2h+1 height with h being the number of cells up and down. This means the array will always be an odd number by an odd number. How would one produce a maze like this one which is an array of 12x12:


    ############
    #...#......#
    ..#.#.####.#
    ###.#....#.#
    #....###.#..
    ####.#.#.#.#
    #..#.#.#.#.#
    ##.#.#.#.#.#
    #........#.#
    ######.###.#
    #......#...#
    ############


    Thanks guys
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Stryder Keeper of "good" ideas. Valued Senior Member

    Messages:
    13,105
    I'm not too sure if there is an answer, but I have an idea for creating a maze routine, but it involves merging some of the rules that you have mentioned and a Philosophical interpretation.

    Take a piece of string of a considerable length, and allow it too loop as you just drop it on the floor. If you move the bundle into an "area", you will have alot of crossing's where the string passes itself.

    The idea is that if you were to take a 12X12 square (144 squares) and make a length of 3/4 of the volume (108 squares), you could then loop this "length" like the string within the 144 area. You could then overlay your original interpretation on top to fix any walls that look odd, or create some dead ends.
    Where it would overlay as string, it would just be a crossing point for the paths.

    Of course you could use a different sum for the amount of Path squares in ratio to wall squares also.
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
Thread Status:
Not open for further replies.

Share This Page