Any examples or ways to make a randomly generate maze and create a path that the player can follow? So that the player doesn't get stuck inside a wall >_< I'm trying to do this with the home screen ASCII, but the graph screen is okay too.
The algorithmic way to make a solveable maze is to use a depth-first recursive search to draw walls. I made a program that does that here:

http://www.cemetech.net/programs/index.php?mode=file&id=536
I can honestly say that I don't understand any of that o_o...
hellninjas wrote:
I can honestly say that I don't understand any of that o_o...
Then you should read the Wikipedia article explaining several methods of maze generation, including this one. Make sure you engage your brain and think hard about it; it's a hard subject and will take effort from you.

http://en.wikipedia.org/wiki/Maze_generation_algorithm#Depth-first_search

Edit: For what it's worth, my specific DFS implementation uses the method under "Randomized Kruskal's algorithm".
KermM: That looks wonderful o.o I remember looking at that article a while back and I understood nothing of it. I am pretty sure I will understand it better now Very Happy

I don't know how well that particular algorithm will work on the homescreen, though.

I know I saw Weregoose post some code somewhere about it that used a binary tree, I believe.
Xeda112358 wrote:
KermM: That looks wonderful o.o I remember looking at that article a while back and I understood nothing of it. I am pretty sure I will understand it better now Very Happy

I don't know how well that particular algorithm will work on the homescreen, though.
I would expect it to work fine, as you can do the same "draw" and "erase" operations on matrix elements if you prefer. It might not be the best option for a homescreen maze program, though.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement