Guest User

Scott Adams Engine 4.6

a guest
Nov 7th, 2015
181
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 10 'COPYRIGHT SCOTT ADAMS. 1978
  2. 20 CLEAR5400:DEFINTA-Z:D=-1
  3. 30 IFD=-1IFMEM<>4526PRINT"BAD LOAD":END
  4. 40 X=Y=Z:K=R=V:N=LL=F:TP$=K$:W=IP=P:Z$="I'VE TOO MUCH TOO CARRY. TRY -TAKE INVENTORY-":GOSUB1240:GOTO100
  5. 50 CLS:PRINT" *** WELCOME TO ADVENTURE LAND. (#4.6) ***":PRINT:PRINT" UNLESS TOLD DIFFERENTLY YOU MUST FIND *TREASURES* AND-RETURN-THEM-TO-THEIR-PROPER--PLACE!"
  6. 60 PRINT:PRINT"I'M YOUR PUPPET. GIVE ME ENGLISH COMMANDS THAT"
  7. 70 PRINT"CONSIST OF A NOUN AND VERB. SOME EXAMPLES...":PRINT:PRINT"TO FIND OUT WHAT YOU'RE CARRYING YOU MIGHT SAY: TAKE INVENTORY TO GO INTO A HOLE YOU MIGHT SAY: GO HOLE TO SAVE CURRENT GAME: SAVE GAME"
  8. 80 PRINT:PRINT"YOU WILL AT TIMES NEED SPECIAL ITEMS TO DO THINGS: BUT I'M SURE YOU'LL BE A GOOD ADVENTURER AND FIGURE THESE THINGS OUT."
  9. 90 PRINT:INPUT" HAPPY ADVENTURING... HIT ENTER TO START";K$:CLS:RETURN
  10. 100 R=AR:LX=LT:DF=0:SF=0:INPUT"USE OLD 'SAVED' GAME";K$:IFLEFT$(K$,1)<>"Y"THEN130
  11. 110 IFD<>-1THENCLOSE:OPEN"I",D,SV$ELSEINPUT"READY SAVED TAPE";K$PRINTINT(IL*5/60)+1;"MINUTES"
  12. 120 INPUT#D:SF,LX:DF,R:FORX=0TOIL:INPUT#D,IA(X):NEXT:IFD<>-1CLOSE
  13. 130 GOSUB50:GOSUB240:GOTO160
  14. 140 INPUT"TELL ME WHAT TO DO":TP$:PRINT:GOSUB170:IFFPRINT"YOU USE WORD(S) I DON'T KNOW":GOTO140
  15. 150 GOSUB360:IFIA(9)=-1THENLX=LX-1:IFLX<0THENPRINT"LIGHT HAS RUN OUT":IA(9)=0ELSEIFLX<25PRINT"LIGHT RUNS OUT IN";LX;"TURNS!"
  16. 160 NV(0)=0:GOSUB360:GOTO140
  17. 170 K=0:NT$(0)="":NT$(1)=""
  18. 180 FORX=1TOLEN(TP$):K$=MID$(TP$,X,1):IFK$=" "THENK=1ELSENT$(K)=LEFT$(NT$(K)+K$,LN)
  19. 190 NEXTX:FORX=0TO1:NV(X)=0:IFNT$(X)=""THEN230ELSEFORY=0TONL:K$=NV$(Y,X):IFLEFT$(K$,1)="*"THENK$=MID$(K$,2)
  20. 200 IFX=1IFY<7THENK$=LEFT$(K$,LN)
  21. 210 IFNT$(X)=K$THENNV(X)=YELSENEXTY:GOTO230
  22. 220 IFLEFT$(NV$(NV(X),X),1)="*"THENNV(X)=NV(X)-1:GOTO220
  23. 230 NEXTX:F=NV(0)<1ORLEN(NT$(1))>0ANDNV(1)<1:RETURN
  24. 240 IFDFIFIA(9)<>-1ANDIA(9)<>RPRINT"I CAN'T SEE: ITS TOO DARK.":RETURN
  25. 250 K=-1:IFLEFT$(RS$(R),1)="*"THENPRINTMID$(RS$(R),2):ELSEPRINT"I'M IN A ";RS$(R);
  26. 260 FORZ=0TOIL:IFKIFIA(Z)=RPRINT". VISIBLE ITEMS HERE: ":K=0
  27. 270 GOTO300
  28. 280 TP$=IA$(Z):IFRIGHT$(TP$,1)="/"FORW=LEN(TP$)-1TO1STEP-1:IFMID$(TP$,W,1)="/"THENTP$=LEFT$(TP$,W-1)ELSENEXTW
  29. 290 RETURN
  30. 300 IFIA(Z)<>RTHEN320ELSEGOSUB280:IFPOS(0)+LEN(TP$)+3>63THENPRINT
  31. 310 PRINTTP$;". ";
  32. 320 NEXT:PRINT
  33. 330 K=-1:FORZ=0TO5:IFKIFRM(R,Z)<>0PRINT"OBVIOUS EXITS: ";:K=0
  34. 340 IFRM(R,Z)<>0PRINTNV$(Z+1,1);" ";
  35. 350 NEXT:PRINT:PRINT:RETURN
  36. 360 F2=-1:F=-1:F3=0:IFNV(0)=1ANDNV(1)<7THEN610ELSEFORX=0TOCL:V=CA(X,0)/150:IFNV(0)=0IFV<>0RETURN
  37. 370 IFNV(0)<>VTHENNEXTX:GOTO990ELSEN=CA(X,0)-V*150
  38. 380 IFNV(0)=0THENF=0:IFRND(100)<=NTHEN400ELSENEXTX:GOTO990
  39. 390 IFN<>NV(1)ANDN<>0THENNEXTX:GOTO990
  40. 400 F2=-1:F=0:F3=-1:FORY=1TO5:W=CA(X,Y):LL=W/20:K=W-LL*20:F1=-1:ONK+1GOTO550,430,450,470,490,500,510,520,530,540,410,420,440,460,480
  41. 410 F1=-1:FORZ=0TOIL:IFIA(Z)=-1THEN550ELSENEXT:F1=0:GOTO550
  42. 420 F1=0:FORZ=0TOIL:IFIA(Z)=-1THEN550ELSENEXT:F1=-1:GOTO550
  43. 430 F1=IA(LL)=-1:GOTO550
  44. 440 F1=IA(LL)<>-1ANDIA(LL)<>R:GOTO550
  45. 450 F1=IA(LL)=R:GOTO550
  46. 460 F1=IA(LL)<>0:GOTO550
  47. 470 F1=IA(LL)=RORIR(LL)=-1:GOTO550
  48. 480 F1=IA(LL)=0:GOTO550
  49. 490 F1=R=LL:GOTO550
  50. 500 F1=IA(LL)<>R:GOTO550
  51. 510 F1=IA(LL)<>-1:GOTO550
  52. 520 F1=R<>LL:GOTO550
  53. 530 F1=SFANDCINT(2^LL+.5):F1=F1<>0:GOTO550
  54. 540 F1=SFANDCINT(2^LL+.5):F1=F1=0:GOTO550
  55. 550 F2=F2ANDF1:IFF2THENNEXTYELSENEXTX:GOTO990
  56. 560 IP=0:FORY=1TO4:K=(Y-1)/2+6:ONYGOTO570,580,570,580
  57. 570 AC=CA(X,K)/150:GOTO590
  58. 580 AC=CA(X,K)-CINT(CA(X,K)/150)*150
  59. 590 IFAC>101THEN600ELSEIFAC=0THEN960ELSEIFAC<52THENPRINTMS$(AC):GOTO960=ELSEONAC-51GOTO660,700,740,760,770,780,790,760,810,830,840,850,860,870,890,920,930,940,950,710,750
  60. 600 PRINTMS$(AC-50):GOTO960
  61. 610 L=DF:IFLTHENL=DFANDIA(9)<>R ANDIA(9)<>-1:IFL PRINT"DANGEROUS TO MOVE IN THE DARK!"
  62. 620 IFNV(1)<1PRINT"GIVE ME A DIRECTION TOO.":GOTO1040
  63. 630 K=RM(R,NV(1)-1):IFK<1IFLTHENPRINT"I FELL DOWN AND BROKE MY NECK.":K=RL:DF=0:ELSEPRINT"I CAN'T GO IN THAT DIRECTION":GOTO1040
  64. 640 IFNOTLCLS
  65. 650 R=K:GOSUB240:GOTO1040
  66. 660 L=0:FORZ=1TOIL:IFIA(Z)=-1LETL=L+1
  67. 670 NEXTZ
  68. 680 IFL>=MXPRINTZ$:GOTO970
  69. 690 GOSUB1050:IA(P)=-1:GOTO960
  70. 700 GOSUB1050:IA(P)=R:GOTO960
  71. 710 PRINT"SAVING GAME":IFD=-1THENINPUT"READY OUTPUT TAPE";K$:PRINTINT(IL*5/60)+1;"MINUTES"ELSEOPEN"O",D,SV$
  72. 720 PRINT#D:SF,LX,DF,R:FORW=0TOIL:PRINT#D,IA(W):NEXT=IFD<>-1CLOSE
  73. 730 GOTO960
  74. 740 GOSUB1050:R=P:GOTO960
  75. 750 GOSUB1050:L=P:GOSUB1050:Z=IA(P):IA(P)=IA(L):IA(L)=Z:GOTO960
  76. 760 GOSUB1050:IA(P)=0:GOTO960
  77. 770 DF=-1:GOTO960
  78. 780 DF=0:GOTO960
  79. 790 GOSUB1050
  80. 800 SF=SF ORCINT(.5+2^P):GOTO960
  81. 810 GOSUB1050
  82. 820 SF=SFANDNOTCINT(.5+2^P):GOTO960
  83. 830 PRINT"I'M DEAD...":R=RL:DF=0:GOTO860
  84. 840 GOSUB1050:L=P:GOSUB1050:IA(L)=P:GOTO960
  85. 850 INPUT"THE GAME IS NOW OVER ANOTHER GAME";K$:IFLEFT$(K$,1)="N"THENENDELSEFORX=0TOIL:IA(X)=I2(X):NEXT:GOTO100
  86. 860 GOSUB240:GOTO960
  87. 870 L=0:FORZ=1TOIL:IFIA(Z)=TRIFLEFT$(IA$(Z),1)="*"LETL=L+1
  88. 880 NEXTZ:PRINT"I'VE STORED";L;"TREASURES. ON A SCALE OF 0 TO 100 THAT RATES A";CINT(L/TT*100):IFL=TTTHENPRINT"WELL DONE.":GOTO850ELSE960
  89. 890 PRINT"I'M CARRYING:":K$="NOTHING":FORZ=0TOIL:IFIA(Z)<>-1THEN910ELSEGOSUB280:IFLEN(TP$)+POS(0)>63PRINT
  90. 900 PRINTTP$;".",;K$=""
  91. 910 NEXT:PRINTK$:GOTO960
  92. 920 P=0:GOTO800
  93. 930 P=0:GOTO820
  94. 940 LX=LT:IA(9)=-1:GOTO960
  95. 950 CLS:GOTO960
  96. 960 NEXTY
  97. 970 IFNV(0)<>0THEN990
  98. 980 NEXTX
  99. 990 '
  100. 1000 IFNV(0)=0THEN1040
  101. 1010 GOSUB1060
  102. 1020 IFFPRINT"I DON'T UNDERSTAND YOUR COMMAND":GOTO1040
  103. 1030 IFNOTF2PRINT"I CAN'T DO THAT YET":GOTO1040
  104. 1040 RETURN
  105. 1050 IP=IP+1:W=CA(X,IP):P=W/20:M=W-P*20:IFM<>0THEN1050ELSERETURN
  106. 1060 IFNV(0)<>10ANDNV(0)<>18ORF3THEN1230
  107. 1070 IFNV(1)=0PRINT"WHAT?":GOTO1180
  108. 1080 IFNV(0)<>10THEN1110
  109. 1090 L=0:FORZ=0TOIL:IFIA(Z)=-1THENL=L+1
  110. 1100 NEXT:IFL>=MXPRINTZ$GOTO1180
  111. 1110 K=0:FORX=0TOIL:IFRIGHT$(IA$(X),1)<>"/"THEN1190ELSELL=LEN(IA$(X))-1:TP$=MID$(IA$(X),1,LL):FORY=LLTO2STEP-1:IFMID$(TP$,Y,1)<>"/"THENNEXTY:GOTO1190
  112. 1120 TP$=LEFT$(MID$(TP$,Y+1),LN)
  113. 1130 IFTP$<>NV$(NV(1),1)THEN1190
  114. 1140 IFNV(0)=10THEN1160
  115. 1150 IFIA(X)<>-1THENK=1:GOTO1190ELSEIA(X)=R:K=3:GOTO1170
  116. 1160 IFIA(X)<>RTHENK=2:GOTO1190ELSEIA(X)=-1:K=3
  117. 1170 PRINT"OK: "
  118. 1180 F=0:RETURN
  119. 1190 NEXTX
  120. 1200 IFK=1THENPRINT"I'M NOT CARRYING IT"ELSEIFK=2PRINT"I DON'T SEE IT HERE"
  121. 1210 IFK=0IFNOTF3PRINT"ITS BEYOND MY POWER TO DO THAT":F=0
  122. 1220 IFK<>0THENF=0
  123. 1230 RETURN
  124. 1240 IFD<>-1THEN1330ELSEINPUT"READY DATA TAPE. HIT ENTER";K$
  125. 1250 INPUT#D,IL,CL,NL,RL,MX,AR,TT,LN,LT,ML,TR
  126. 1260 W=(IL+CL/2+NL/10+RL+ML)/12=PRINTW+1;"MINUTES TO LOAD."
  127. 1270 DIMNV(1),CA(CL,7),NV$(NL,1),IA$(IL),IA(IL),RS$(RL),RM(RL,5),MS$(ML),NT$(1),I2(IL)
  128. 1280 FORX=0TOCL STEP2:Y=X+1:INPUT#D,CA(X,0),CA(X,1),CA(X,2),CA(X,3),CA(X,4),CA(X,5),CA(X,6),CA(X,7),CA(Y,0),CA(Y,1),CA(Y,2),CA(Y,3),CA(Y,4),CA(Y,5),CA(Y,6),CA(Y,7):NEXT
  129. 1290 FORX=0TONLSTEP10:FORY=0TO1:INPUT#D,NV$(X,Y),NV$(X+1,Y),NV$(X+2,Y),NV$(X+3,Y),NV$(X+4,Y),NV$(X+5,Y),NV$(X+6,Y),NV$(X+7,Y),NV$(X+8,Y),NV$(X+9,Y):NEXTY,X
  130. 1300 FORX=0TORL:INPUT#D,RM(X,0),RM(X,1),RM(X,2),RM(X,3).RM(X,4),RM(X,5),RS$(X):NEXT
  131. 1310 FORX=0TOML:INPUT#D,MS$(X):NEXT
  132. 1320 FORX=0TOIL:INPUT#D,IA$(X),IA(X):I2(X)=IA(X):NEXT:IFD=-1RETURN
  133. 1330 REM
RAW Paste Data