Author Topic: Maze Generation Program - BASIC  (Read 6031 times)

0 Members and 1 Guest are viewing this topic.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Maze Generation Program - BASIC
« 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, 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)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Maze Generation Program - BASIC
« Reply #1 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 :)
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Maze Generation Program - BASIC
« Reply #2 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

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Maze Generation Program - BASIC
« Reply #3 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.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Maze Generation Program - BASIC
« Reply #4 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 :)
« Last Edit: November 24, 2010, 04:56:27 pm by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Maze Generation Program - BASIC
« Reply #5 on: November 24, 2010, 05:17:03 pm »
What algorithm do you use? It looks very interesting, and fairly fast!

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Maze Generation Program - BASIC
« Reply #6 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
Just scroll down a bit ;D
« Last Edit: November 24, 2010, 05:19:26 pm by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Maze Generation Program - BASIC
« Reply #7 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

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Maze Generation Program - BASIC
« Reply #8 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, 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
« Last Edit: November 24, 2010, 05:20:37 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Maze Generation Program - BASIC
« Reply #9 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
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".
« Last Edit: November 24, 2010, 05:21:33 pm by graphmastur »

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Maze Generation Program - BASIC
« Reply #10 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 ;)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Maze Generation Program - BASIC
« Reply #11 on: November 24, 2010, 05:22:52 pm »
Now to make one where you can go through the maze.
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Maze Generation Program - BASIC
« Reply #12 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.
« Last Edit: November 24, 2010, 05:23:48 pm by graphmastur »

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Maze Generation Program - BASIC
« Reply #13 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...
« Last Edit: November 24, 2010, 05:26:11 pm by happybobjr »
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Maze Generation Program - BASIC
« Reply #14 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.