Computer Science Canada [source] Maze Program in 100 Lines |
Author: | zylum [ Mon May 23, 2005 9:27 pm ] | ||
Post subject: | [source] Maze Program in 100 Lines | ||
ultrahex's maze program inspired me to make one aswell... mine is a lot faster and more efficient, but his is more visually apealling.
|
Author: | Delos [ Mon May 23, 2005 9:42 pm ] |
Post subject: | |
zylum strikes again. Great work as usual. I Believe! I Believe! It can be solved. w00t. 241 seconds. Now my eyes hurt. Anyway, have some bits, and next time make the movement smoother. + bits. Edit: Wait...are you now a mod? Or are those 1000 bits just coincidence? We'll see... |
Author: | zylum [ Mon May 23, 2005 10:13 pm ] |
Post subject: | |
ofcourse it can be solved, what would be the point if it couldnt? wait a second... this gives me an idea... ![]() |
Author: | Bacchus [ Tue May 24, 2005 5:52 am ] |
Post subject: | |
wow really nice, but yes my eyes now hurt lol. 150.299 seconds lol, cmon Delos, you can do it faster! ![]() |
Author: | RaPsCaLLioN [ Tue May 24, 2005 8:59 am ] |
Post subject: | |
110.566. Very nice. However.. It basically created a path for me to the end. At no point did it give me extended forked pathways. When it did I could see that one option always ended immediately so the decision was obvious. So it could be a bit more difficult. I'm now going to beat it in under 100 secs. |
Author: | Cervantes [ Tue May 24, 2005 2:51 pm ] |
Post subject: | |
Nice stuff, zylum. 87 seconds, first try. Like rapscallion, I didn't get very many alternatives. In fact, I think I only got one real alternative that actually lead somewhere (there were many that go for a few squares, but not much more than that). I happened to make the right guess on that one real alternative that I did get. ![]() Does this work such that there is only one possible path to get there (without retracing, that is)? |
Author: | zylum [ Tue May 24, 2005 3:18 pm ] |
Post subject: | |
yeah. there is always exactly 1 route from any square to any other square and all squares are reachable... i also noticed that the generated mazes are easy, but i dont know why... what my algorithm does is it starts at (1,1) and then makes a random path (only going to squares that have not been travelled on yet) untill it cannot travel anymore (no unoccupied squares to move to). once the current path ends, then it traces back untill it finds a square which can have a path branch from it. any ideas on how to make it harder? |
Author: | Delos [ Tue May 24, 2005 5:05 pm ] |
Post subject: | |
Well, if any two squares can be reached by some path, how about you alter the goal a bit. Randomly choose two squares on the board and set the aim to be to get from one to the other. You can work on the logistics of making sure they're not too close. Also, you could start your creation of the maze from somewhere other than a corner. Or, if your recurssion would allow it, at more than one point. The only problem here is ensuring that the two mazes connect...but you could figure that out... ![]() |
Author: | zylum [ Tue May 24, 2005 7:01 pm ] |
Post subject: | |
starting from a random location was a good idea... i updated the source and now its a *bit* harder... the idea i have is that instead of backtracking to the first square which has a path, i have an array of squares which still have a path and then randomly choose one to fork from.. the maze will be finished generating when there are no more paths to fork from. i'll try implementing it later tonight. if anybody else wants to try this algorithm with my source, go right ahead ![]() |
Author: | Delos [ Tue May 24, 2005 7:34 pm ] | ||
Post subject: | |||
zylum wrote:
Did you really update that? Or did you mean you only updated on your computer and left us here w/ the old source? |
Author: | zylum [ Tue May 24, 2005 8:31 pm ] |
Post subject: | |
px and py refer to the starting position of the dot... im my initialize method, i call genMaze like so: genMaze (Rand.Int (1, cols), Rand.Int (1, rows)) it used to be: genMaze(1,1) so ya, it's updated |
Author: | jamonathin [ Tue May 24, 2005 9:02 pm ] |
Post subject: | |
Amazing job. I still cannot figure out how you make it so that there's never an area blocked off, and that you will always reach the end eventually, but I'll just keep lookin it over. I have a dumb question though, why is there a ~ before adjMatrix, is that because you want to make sure its false? ![]() ![]() Anyways, good job, well done. ![]() ![]() + 57 Bits |
Author: | Delos [ Tue May 24, 2005 10:12 pm ] |
Post subject: | |
It's all about recursion. If you check his fcn out, it's set up so that every box connects to at least one other box. So, since no routes are completely blocked off, every square is accessible. Also, I think zylum is admin of sorts now...bits don't mean anything to him... |
Author: | jamonathin [ Wed May 25, 2005 7:47 am ] |
Post subject: | |
Delos wrote: It's all about recursion. If you check his fcn out, it's set up so that every box connects to at least one other box. So, since no routes are completely blocked off, every square is accessible.
Ok that makes sense, I took another look and I can see it now ![]() Delos wrote: Also, I think zylum is admin of sorts now...bits don't mean anything to him... |
Author: | Delos [ Wed May 25, 2005 8:48 am ] |
Post subject: | |
He's at 1057 now, but wait till he posts again...perhaps the zylum himself could clear up this uncertainty... ![]() |
Author: | zylum [ Wed May 25, 2005 4:06 pm ] |
Post subject: | |
yeah im the new flash mod ![]() anyways, i have a commented version of the program too. i just shortened it so that it would fit the title of the thread 8) |
Author: | jamonathin [ Wed May 25, 2005 6:02 pm ] |
Post subject: | |
Congrats on the new mod job thinger ![]() ![]() Could you possibly send that code with the comments, cuz your program is sorta hard to figure out exactly, i can figure out most of it, but if you could send that, it'd be much appreciated. |
Author: | zylum [ Wed May 25, 2005 6:17 pm ] |
Post subject: | |
sure... ill post it later tonight. heres your 57 bits back btw ![]() |
Author: | jamonathin [ Wed May 25, 2005 8:44 pm ] |
Post subject: | |
lmao!!!11 I didn't mean i wanted em back, ![]() ![]() |
Author: | zylum [ Wed May 25, 2005 11:28 pm ] |
Post subject: | |
ok tons of comments. have fun ![]() |
Author: | jamonathin [ Thu May 26, 2005 7:43 am ] |
Post subject: | |
Thanks for those comments, very detailed, very fun ![]() |
Author: | goboenomo [ Thu Oct 13, 2005 11:45 am ] |
Post subject: | |
NICE WORK thats pretty tight thats a bit big of a maze though hahahah and some of your pathways leading to dead ends are a bit long.. wastes time but good job though |
Author: | [Gandalf] [ Thu Oct 13, 2005 2:41 pm ] |
Post subject: | |
Would it be a maze if it was easy? And please stop posting in old topics, with such simple comments. If you are going to revive a topic, make sure there is some reason. Read the rules if you were not aware. |
Author: | goboenomo [ Sun Oct 30, 2005 5:03 pm ] |
Post subject: | |
im not saying make it easy... its just the deads end go on forever anyways i didnt look at the date when i was posting over this sorry |