Home » Recent acquisitions » Commodore_16 » tape009b_c16_commodore_16_games_pack_1.wav » 2d maze
2d maze
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Recent acquisitions » Commodore_16 » tape009b_c16_commodore_16_games_pack_1.wav |
Filename: | 2d maze |
Read OK: | ✔ |
File size: | 06A6 bytes |
Load address: | 1001 |
Exec address: | 0000 |
File contents
10 PRINT"<clr>WAIT":COLOR1,1:DX=9:DY=9:XF=5:YF=9 20 DIMMZ%(DX,DY) 30 RESTORE 40 FORI=0TODY:FORJ=0TODX:READMZ%(J,I):NEXTJ,I 50 DATA15,3,4,7,5,7,5,5,15,5,11,14,5,13,5,13,5,3,10,6,14,11,6,5,5,5,7,11,8,10 60 DATA10,8,10,6,3,6,11,12,7,9,12,5,9,8,6,12,15,5,13,3,5,5,3,6,15,3,10,2,6,13 70 DATA7,5,9,10,10,12,9,10,12,5,14,7,5,9,12,5,5,15,5,1,11,14,5,7,7,5,3,10,4,5 80 DATA11,8,4,9,8,4,9,12,7,5 90 DEFFNL(X)=((X*2)AND15)+INT((XAND8)/8) 100 DEFFNR(X)=INT(X/2)+(XAND1)*8 110 X=INT(RND(0)*6+2):Y=INT(RND(0)*5):D%=2^INT(RND(0)*4):GRAPHIC2,0:GOSUB210 120 GETA$:IFA$<>"I"ANDA$<>"P"ANDA$<>" "THEN120 130 IFA$="I"THEND%=FNR(D%):GOSUB210:GOTO120 140 IFA$="P"THEND%=FNL(D%):GOSUB210:GOTO120 150 IF(D%ANDMZ%(X,Y))=1THENX=X-1:IFX<0THENX=DX 160 IF(D%ANDMZ%(X,Y))=2THENY=Y+1:IFY>DYTHENY=0 170 IF(D%ANDMZ%(X,Y))=4THENX=X+1:IFX>DXTHENX=0 180 IF(D%ANDMZ%(X,Y))=8THENY=Y-1:IFY<0THENY=DY 190 GOSUB210:IFX=XFANDY=YFTHENGRAPHIC0:END 200 GOTO120 210 SCNCLR:XN=X:YN=Y:IF(D%ANDMZ%(X,Y))=0THENRETURN 220 IF(D%ANDMZ%(X,Y))=1THENXN=X-1:IFXN<0THENXN=DX 230 IF(D%ANDMZ%(X,Y))=2THENYN=Y+1:IFYN>DYTHENYN=0 240 IF(D%ANDMZ%(X,Y))=4THENXN=X+1:IFXN>DXTHENXN=0 250 IF(D%ANDMZ%(X,Y))=8THENYN=Y-1:IFYN<0THENYN=DY 260 DRAW1,0,0TO87,57:DRAW1,0,159TO87,130:DRAW1,319,0TO232,57:DRAW1,319,159TO232,130 270 IF(MZ%(XN,YN)ANDD%)=0THEN300 280 BOX1,157,103,162,107:DRAW1,157,103TO130,85:DRAW1,162,103TO189,85 290 DRAW1,157,107TO130,116:DRAW1,162,107TO189,116:GOTO310 300 DRAW1,130,85TO189,85:DRAW1,130,116TO189,116 310 IF(MZ%(XN,YN)ANDFNR(D%))=0THEN340 320 DRAW1,87,57TO87,130:DRAW1,130,85TO87,85:DRAW1,130,116TO87,116 330 IF(MZ%(XN,YN)ANDD%)>0THENDRAW1,130,85TO130,116 340 IF(MZ%(XN,YN)ANDFNL(D%))=0THEN370 350 DRAW1,232,57TO232,130:DRAW1,189,85TO232,85:DRAW1,189,116TO232,116 360 IF(MZ%(XN,YN)ANDD%)>0THENDRAW1,189,85TO189,116 370 IF(MZ%(XN,YN)ANDFNL(D%))>0THEN400 380 DRAW1,232,57TO189,85:DRAW1,232,130TO189,116 390 IF(MZ%(XN,YN)ANDD%)=0THENDRAW1,189,85TO189,116 400 IF(MZ%(XN,YN)ANDFNR(D%))>0THEN430 410 DRAW1,87,57TO130,85:DRAW1,87,130TO130,116 420 IF(MZ%(XN,YN)ANDD%)=0THENDRAW1,130,85TO130,116 430 IFXN=XFANDYN=YFTHENCHAR1,18,11,"HOME" 440 RETURN
' �"�WAIT":�1,1:DX�9:DY�9:XF�5:YF�9 7 �MZ%(DX,DY) = � `( �I�0�DY:�J�0�DX:�MZ%(J,I):�J,I �2 �15,3,4,7,5,7,5,5,15,5,11,14,5,13,5,13,5,3,10,6,14,11,6,5,5,5,7,11,8,10 �<