A new type-in, I hope, from Home Computing Weekly Nov. 83.
A very nice, but SLOOOOOOW, random maze generator, use a fast emulator.
Check out line 60, got to be one of the most complex lines I've ever seen and Sinclair Basic handles it nicely. I've included the mag scans in case I made a typo somewhere.
No special hardware required just a 16K RAM pack.
Enjoy;
Greg
Random Maze Creator
Random Maze Creator
- Attachments
-
- Maze Creator (16K).zip
- Program and magscans
- (879.47 KiB) Downloaded 261 times
Re: Random Maze Creator
Interesting! Would this be something for MCODER?
Re: Random Maze Creator
I like it! And yes, I don't see anything in particular that would upset MCODER. Well, MCODER 2 anyway - I don't have any experience with the original MCODER. One or two lines will need tweaking (perhaps line 60 will need to be broken down into separate IF statements, I'm not sure), but that's always the way.
Having said that, it looks like it would be fun to translate it into machine code by hand too. I wonder how fast we could get it to go?
Having said that, it looks like it would be fun to translate it into machine code by hand too. I wonder how fast we could get it to go?
Re: Random Maze Creator
Doesn't MC2 only allow for a STRING length of 32 CHRS ? in which case line 103 will be hard to get round.
Re: Random Maze Creator
In line 265, C$(CN TO) might as well say C$(CN TO CN+1). He only ever writes two characters at a time into the maze, as far as I can see. The DIM of C$ just makes sure he doesn't get a subscript out of range when he puts the two characters at those positions for the first time. He throws away C$ at line 1164 anyway. So I think as long as we have 2680 bytes of RAM spare somewhere A, we can just POKE A+CN,X and POKE A+CN+1,Y and that's that. CODE C$(CN) would become PEEK (A+CN).
Perhaps he deliberately says C$(CN TO ) in order to blank out the rest of the workspace - after backtracking? - so we'd have to make sure that behaviour was retained if necessary.
I see there are some non-integers at around line 930, but we can probably get around those.
Perhaps he deliberately says C$(CN TO ) in order to blank out the rest of the workspace - after backtracking? - so we'd have to make sure that behaviour was retained if necessary.
I see there are some non-integers at around line 930, but we can probably get around those.
Re: Random Maze Creator
Here is a version that uses RAM in 8192-16383 as workspace, can be compiled with MCODER II, and run with LET L=USR 20500:
- Attachments
-
- mcmc.zip
- (6.3 KiB) Downloaded 226 times
Re: Random Maze Creator
Very nice!