Advertisement Jump to content
Sign in to follow this  
gnomer

need help with maze generator function

This topic is 4882 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to generate a maze. The maze is represented by a double subscripted char array maze[12][12]. Example maze:
 ############
 #...#......#
 S.#.#.####.#
 ###.#....#.#
 #....###.#.E
 ####.#.#.#.#
 #..#.#.#.#.#
 ##.#.#.#.#.#
 #........#.#
 ######.###.#
 #......#...#
 ############


# = wall S = start E = end . = path The function is supposed to take as arguments a double subscripted char array and the starting and ending locations of the maze. If anyone can point me in the right direction I would appreciate it.

Share this post


Link to post
Share on other sites
Advertisement
Hmm. The traditional algorithm for random, perfect maze generation is depth-first search, but you may have trouble making it work with your format.

Look here.

Share this post


Link to post
Share on other sites
yea I found that page also but I don't know how to apply it to this format. This is how the book said to do it so I know there is a way. I just haven't figured it out yet :(

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!