Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Random maze algorithm?

Author
Message
Nebin
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: At my computer?
Posted: 25th Aug 2006 21:45
Hello

I am trying to write a maze game but am unaware of how to make a random maze algorithm that generates a perfect maze. I wanted something that put 1’s and 2’s into an array, where 1’s are walls and 2’s are paths. Then I could use that to plot tiles or whatever else I wanted to make the maze out of. I tried to make my own but it ended up with a lot of inaccessible areas. I’ll post the code below (Also I could not get the Save Array command working). Can anyone help me write a working maze algorithm? Thanks!




A picture is worth a thousand words...in basic
Code Dragon
18
Years of Service
User Offline
Joined: 21st Aug 2006
Location: Everywhere
Posted: 25th Aug 2006 23:55 Edited at: 28th Oct 2006 04:31
Message erased, don't listen to the dumb idea I posted before editing this message.

Confucius Say...
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 26th Aug 2006 00:50
Here's some code I wrote a long time ago that generates a perfect maze, ie a maze with only one path. Press a key after each maze to generate another one. End up with x1 and y1 being coords of furthest path



Boo!
Nebin
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: At my computer?
Posted: 26th Aug 2006 17:34
Thanks I think I got it now...But I still donn't understand how to use the Load/Save array command, can you help me on that?

A picture is worth a thousand words...in basic
Code Dragon
18
Years of Service
User Offline
Joined: 21st Aug 2006
Location: Everywhere
Posted: 26th Aug 2006 19:51
I just tried using the Load and Save Array commands, and unless you give the full path of the file, it's saved in the TEMP folder.

Login to post a reply

Server time is: 2024-09-25 07:35:32
Your offset time is: 2024-09-25 07:35:32