Random Maze Creator

General games-related topics
Post Reply
User avatar
GCHarder
Posts: 274
Joined: Sat Dec 14, 2013 7:46 pm

Random Maze Creator

Post by GCHarder »

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
Screenie
Screenie
Screen 1.jpg (51.82 KiB) Viewed 2727 times
Screen 2.jpg
Screen 2.jpg (58.94 KiB) Viewed 2727 times
Attachments
Maze Creator (16K).zip
Program and magscans
(879.47 KiB) Downloaded 144 times
olofsen
Posts: 177
Joined: Wed Jan 08, 2014 12:29 pm

Re: Random Maze Creator

Post by olofsen »

Interesting! Would this be something for MCODER?
poglad
Posts: 133
Joined: Mon Mar 24, 2014 3:11 pm
Location: Aberdeen, Scotland

Re: Random Maze Creator

Post by poglad »

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? :geek:
Moggy
Posts: 2347
Joined: Wed Jun 18, 2008 2:00 pm

Re: Random Maze Creator

Post by Moggy »

Doesn't MC2 only allow for a STRING length of 32 CHRS ? in which case line 103 will be hard to get round.
poglad
Posts: 133
Joined: Mon Mar 24, 2014 3:11 pm
Location: Aberdeen, Scotland

Re: Random Maze Creator

Post by poglad »

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.
olofsen
Posts: 177
Joined: Wed Jan 08, 2014 12:29 pm

Re: Random Maze Creator

Post by olofsen »

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 123 times
poglad
Posts: 133
Joined: Mon Mar 24, 2014 3:11 pm
Location: Aberdeen, Scotland

Re: Random Maze Creator

Post by poglad »

Very nice!
Post Reply