|
Post by quickthumbs on Jan 7, 2016 15:32:20 GMT -5
Hey, everyone! Sorry if it is a bit presumptuous to make an account and just ask for help without introductions, but I really am pressed for time these days. Anyway, I've been working on a maze generator in BASIC and got a pretty decent depth-first version running. (I'll post it if required). But like any programmer, I want it to be as fast as possible. I came across this program in a vintage book, and cannot for the life of me crack it, but it seems to be faster than depth-first. Does anyone know precisely WHAT the program is doing? Maybe then it will be easier to crack and apply to graphics. www.atariarchives.org/basicgames/showpage.php?page=3
|
|
|
Post by meerkat on Jan 7, 2016 18:27:56 GMT -5
Not much to it. It's not graphic. It simply uses print statements and a random number generator to determine what to print. Probably the easiest way to test it is to type the program in RunBasic and try it. Convert the commands that don't exist is Run Basic. For example the 'ON' command goes to a line number depending if it is negative, zero, or positive. So ON x goto 100,200,300 should convert to: if x < 0 then goto 100 if x = 0 then goto 200 if x > 0 then goto 300 Normally don't use line numbers in RunBasic, however to maintain backward compatibility you can use them. Probably a better place to look at a maze generator is here: MazeHope this helps..
|
|
|
Post by quickthumbs on Jan 8, 2016 11:53:18 GMT -5
Oh, I've tested it in multiple BASIC dialects. I just don't understand how random numbers alone can build a maze with one clear path. It seems like the output should be just a jumble.
|
|