Omnimaga

Calculator Community => Other Calculators => Topic started by: calcdude84se on November 23, 2010, 09:32:15 pm

Title: Maze Generation Program - BASIC
Post by: calcdude84se on November 23, 2010, 09:32:15 pm
Might as well upload one of my old BASIC creations, especially since someone's made an Axe one ;D
This one is based on Eller's Algorithm (http://www.astrolog.org/labyrnth/algrithm.htm#perfect (http://www.astrolog.org/labyrnth/algrithm.htm#perfect), scroll down a bit)
When you start it it asks for four numbers: How long it should be (X), How wide it should be (Y), and chances for carving vertically and horizontally (give as a decimal, not a percent ;))
I'm sure if Weregoose looked at it he could find numerous optimizations :P
It can generate a full-screen maze in a few minutes.
I've included two screenshots: one of it generating a 48*32 maze (for the impatient among you :P) and one of a full maze.
Enjoy! (Yeah, it's slow, but whatever :P)
Title: Re: Maze Generation Program - BASIC
Post by: meishe91 on November 23, 2010, 09:53:42 pm
That's pretty cool. I didn't know someone made an Axe map generator though ??? Good work on it though :)
Title: Re: Maze Generation Program - BASIC
Post by: ztrumpet on November 23, 2010, 11:21:24 pm
That's not very slow.  It's amazing what can be done in Basic. :) Great job. ;D
Title: Re: Maze Generation Program - BASIC
Post by: DJ Omnimaga on November 23, 2010, 11:39:07 pm
THis is great! Hopefully it can be useful to someone. :D
That's pretty cool. I didn't know someone made an Axe map generator though ??? Good work on it though :)
JustCause posted one a few days ago.
Title: Re: Maze Generation Program - BASIC
Post by: calcdude84se on November 24, 2010, 04:56:06 pm
Thanks :)
I should port this to Axe, because it would only need about 100 bytes of RAM to store data for the maze while generating it (outside of the graphscreen, of course)
I'll do that when I have the time :)
Title: Re: Maze Generation Program - BASIC
Post by: jnesselr on November 24, 2010, 05:17:03 pm
What algorithm do you use? It looks very interesting, and fairly fast!
Title: Re: Maze Generation Program - BASIC
Post by: calcdude84se on November 24, 2010, 05:18:31 pm
I used Eller's Algorithm. You can read about it at http://www.astrolog.org/labyrnth/algrithm.htm#perfect (http://www.astrolog.org/labyrnth/algrithm.htm#perfect)
Just scroll down a bit ;D
Title: Re: Maze Generation Program - BASIC
Post by: DJ Omnimaga on November 24, 2010, 05:18:50 pm
Thanks :)
I should port this to Axe, because it would only need about 100 bytes of RAM to store data for the maze while generating it (outside of the graphscreen, of course)
I'll do that when I have the time :)
But JustCause made one for Axe ???

http://ourl.ca/8012
Title: Re: Maze Generation Program - BASIC
Post by: meishe91 on November 24, 2010, 05:19:58 pm
What algorithm do you use? It looks very interesting, and fairly fast!

*cough cough*

Might as well upload one of my old BASIC creations, especially since someone's made an Axe one ;D
This one is based on Eller's Algorithm (http://www.astrolog.org/labyrnth/algrithm.htm#perfect (http://www.astrolog.org/labyrnth/algrithm.htm#perfect), scroll down a bit)
When you start it it asks for four numbers: How long it should be (X), How wide it should be (Y), and chances for carving vertically and horizontally (give as a decimal, not a percent ;))
I'm sure if Weregoose looked at it he could find numerous optimizations :P
It can generate a full-screen maze in a few minutes.
I've included two screenshots: one of it generating a 48*32 maze (for the impatient among you :P) and one of a full maze.
Enjoy! (Yeah, it's slow, but whatever :P)

;)

Edit:
Damn, ninja'd :P
Title: Re: Maze Generation Program - BASIC
Post by: jnesselr on November 24, 2010, 05:20:47 pm
I used Eller's Algorithm. You can read about it at http://www.astrolog.org/labyrnth/algrithm.htm#perfect (http://www.astrolog.org/labyrnth/algrithm.htm#perfect)
Just scroll down a bit ;D
Oh, interesting.  a page about maze algorithms. Nice.

EDIT: Oh, sorry, I saw the screenshots and thought "ooh, shiny".
Title: Re: Maze Generation Program - BASIC
Post by: calcdude84se on November 24, 2010, 05:21:06 pm
prgmMAZE is a backtracking maze generator. When there are no available spots to carve, it backtracks until there is an open space. Because of memory limitations, large mazes will start writing outside of saferam: be careful if you decide to adjust the size! (to do this, recompile with different values for L and W.)
DJ, mine won't corrupt RAM ;)
Title: Re: Maze Generation Program - BASIC
Post by: Happybobjr on November 24, 2010, 05:22:52 pm
Now to make one where you can go through the maze.
Title: Re: Maze Generation Program - BASIC
Post by: jnesselr on November 24, 2010, 05:23:10 pm
Now to make one where you can go through the maze.
In grayscale 3D, of course.

EDIT: My post was made within 18 seconds of your post. I wonder what the record is.
Title: Re: Maze Generation Program - BASIC
Post by: Happybobjr on November 24, 2010, 05:26:00 pm
I have had it with in 2 sec. before when we were all waiting for a new version of axe to come out.
....I was refreshing my page for a straight hour...
Title: Re: Maze Generation Program - BASIC
Post by: DJ Omnimaga on November 24, 2010, 10:17:45 pm
prgmMAZE is a backtracking maze generator. When there are no available spots to carve, it backtracks until there is an open space. Because of memory limitations, large mazes will start writing outside of saferam: be careful if you decide to adjust the size! (to do this, recompile with different values for L and W.)
DJ, mine won't corrupt RAM ;)
Ah right, but for small ones it's fine, right?
EDIT: My post was made within 18 seconds of your post. I wonder what the record is.
A few days ago, I think two people posted at once on the exact same second.