8-Bit Software Online Conversion

Secret Maze - Listing

10REM Secret Maze 20REM (C) 1995 Jon Ripley 30REM Mini-Adventure Player 40REM (C) 1995 Jon Ripley 50REM DO NOT ALTER this program or us e any part of it within your own program s 60REM Created using the Mini-Adventur e creator (C) 1995 Jon Ripley 70IF PAGE<>&1D00 :PAGE=&1D00:CHAIN"Sc tMaze" 80MODE7 90*FX200,3 100LOMEM=TOP+&80:FORZ%=0TO&7D:Z%?&482= Z%?TOP:NEXT:?2=?(TOP+&7E):?3=?(TOP+&7F) 110PROCinit 120REPEAT 130IF oldroom=-2 PROCwrap(advname$):PR INT:PROCwrap(welcome$):PRINT'"Press any key to begin the adventure...";:IFGET 140IF room<>oldroom PROCdescribe 150strength=strength-1 160IF (endroom=0 AND score>=winscore) OR (endroom=room AND winscore=0) OR (end room=room AND score>=winscore) PRINT"Con gratulations!"':PROCwrap(win$):REPEATUNT ILGET:CALL!-4 170IFstrength<1 PROCend 180REPEAT 190INPUTLINE"?"b$ 200IFb$="" PRINT"Eh?" 210UNTILb$<>"" 220IF INSTR(b$," ")=0 b$=b$+" " 230a$=LEFT$(b$,INSTR(b$," ")-1) 240b$=MID$(b$,INSTR(b$," ")+1) 250ct=0 260FORt=1TO13 270IFINSTR(m$(t),a$)=1 ct=t:t=14 280NEXT 290IFct=0PRINT"Not possible.":UNTILFAL SE 300IFct<7 IF exit(room,ct)>0 room=exit (room,ct):oldroom=-1:UNTILFALSE 310IFct<7 PRINT"Can't move that way" 320IFct=7 PROCtake 330IFct=8 PROCdrop 340IFct=9 PROCunlock 350IFct=11 PROCinv 360IFct=12 oldroom=-1 370IFct=13 PRINT"Score...";score'"Stre ngth...";strength 380UNTIL ct=10 390PROCend 400DEFPROCdescribe 410oldroom=room 420CLS 430PROCwrap("You are "+room$(room)) 440PRINT'"There are exit(s):" 450x$="" 460FORt=1TO6 470IFexit(room,t)>0 x$=x$+m$(t)+"..." 480IFexit(room,t)<0 x$=x$+m$(t)+" thro ugh a door..." 490NEXT 500PROCwrap(x$) 510PRINT'"You can see:" 520x$="" 530FORt=1TOobjects 540IFobject(t,1)=room x$=x$+object$(t) +", " 550NEXT 560IF x$="" PRINT"Nothing." ELSE PROCw rap(LEFT$(x$,LENx$-2)+".") 570PRINT 580ENDPROC 590DEFPROCtake 600inv=0 610FORt=1TOobjects 620IF b$=object$(t) AND object(t,1)=ro om AND object(t,2)=1 takable=TRUE ELSE t akable=FALSE 630IF takable=TRUE AND object(t,4)>=0 object(t,1)=0:inv=1:score=score+object(t ,4) 640IF takable=TRUE AND object(t,4)<0 s trength=strength-ABSobject(t,4):PRINT"Ou ch!":inv=2 650NEXT 660IF inv=1 oldroom=-1:ENDPROC 670IF inv=0 PRINT"Not possible." 680ENDPROC 690DEFPROCdrop 700inv=0 710FORt=1TOobjects 720IF b$=object$(t) AND object(t,1)=0 object(t,1)=room:inv=1:score=score-objec t(t,4) 730NEXT 740IFinv=1 oldroom=-1:ENDPROC 750PRINT"Not possible." 760ENDPROC 770DEFPROCinv 780PRINT"You have the following..." 790obs=FALSE 800FORt=1TOobjects 810IFobject(t,1)=0 PRINTobject$(t)":"; :obs=TRUE 820NEXT 830IF obs PRINT ELSE PRINT"Nothing." 840ENDPROC 850DEFPROCunlock 860IF b$<>"DOOR" PRINT"Unlock what?":E NDPROC 870doors=0 880FOR x=1 TO 6 890IF exit(room,x)<0 doors=doors+1:IF object(-exit(room,x),1)=0 exit(room,x)=o bject(-exit(room,x),3):PROCwrap("Opened the "+m$(x)+" door."):oldroom=-1 900IF exit(room,x)<0 IF object(-exit(r oom,x),1)<>0 PROCwrap("You don't have th e key for the "+m$(x)+" door.") 910NEXT 920IF doors=0 PRINT"There are no doors here to open." 930ENDPROC 940DEFPROCend 950PROCwrap(lose$) 960PRINT"Goodbye..." 970REPEATUNTILGET 980CALL!-4 990DEFPROCinit 1000FORt=1TO13:READm$(t):NEXT 1010ENDPROC 1020DATA NORTH,SOUTH,EAST,WEST,UP,DOWN, TAKE,DROP,UNLOCK,QUIT,INVENTORY,LOOK,SCO RE 1030DEFPROCwrap(a$):LOCAL p,a:IF a$<>"" a=39 ELSE ENDPROC 1040a$=a$+" " 1050REPEAT 1060p=a+1 1070REPEATp=p-1:UNTILMID$(a$,p,1)=" "OR p=1 1080IFp=1 p=LENa$ 1090PRINTLEFT$(a$,p):a$=MID$(a$,p+1) 1100UNTILa$="" 1110ENDPROC