home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 2 / 002.d81 / detective! (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  10KB  |  349 lines

  1. 1 rem adapted from apple detective by larry jasonwicz
  2. 2 poke783,peek(783)and254
  3. 6 poke53272,23:poke53280,13:poke53281,1:printchr$(151)
  4. 10 goto82
  5. 11 ifsu(x)=1thenloc$="[212]avern":si$=ew$(1):twn$=ar$(1):return
  6. 12 ifsu(x)=2thenloc$="[195]afe":si$=ew$(2):twn$=ar$(2):return
  7. 13 ifsu(x)=3thenloc$="[197]mbassy":si$=ew$(3):twn$=ar$(3):return
  8. 14 loc$="[196]ocks":si$=ew$(4):twn$=ar$(4):return
  9. 15 ifew(x)=1then ew$(x)="[197]ast":return
  10. 16 ew$(x)="[215]est":return
  11. 17 tn$="[212]own"
  12. 18 ifar(x)=1thenar$(x)="[213]p":return
  13. 19 ifar(x)=2thenar$(x)="[205]id":return
  14. 20 ar$(x)="[196]own":return
  15. 21 forbb=1toaa:print"-";:next:return
  16. 22 fori=1to4:d(i)=0:next:y=0:return
  17. 82 printchr$(147):gosub45000
  18. 90 poke781,23:poke782,4:sys65520:print" [196]o you want instructions (y/n)?[160]";
  19. 91 poke198,0:wait198,1:getny$
  20. 92 ifny$="n"then100
  21. 93 ifny$="y"then95
  22. 94 goto90
  23. 95 print"[147]load"chr$(34)"det.instructions"chr$(34)",8":print"run"
  24. 96 poke631,13:poke632,13:poke198,2:end
  25. 100 dimsu$(17),su(17),loc$(17),an$(5,18,8),si(5,18)
  26. 101 pr$="[208]ress <space bar> to continue."
  27. 102 yo$="[217]ou don't know the weapon location yet."
  28. 103 s1$="[217]ou don't know if this suspect was at"
  29. 104 s2$="the place of the murder weapon."
  30. 105 sp$="                                       "
  31. 110 printchr$(147)
  32. 200 a=1:b=15
  33. 220 gosub22
  34. 240 forx=atobstep2
  35. 260 ra=int(4*rnd(1)+1)
  36. 265 z=int(rnd(1)*23)+1:zz=int(rnd(1)*39)+1:poke781,z:poke782,zz:sys65520:print"*"
  37. 280 ifd(ra)=1goto260
  38. 300 su(x)=ra
  39. 320 d(ra)=1:y=y+1:ify=4thengosub22
  40. 330 ifx=16goto400
  41. 340 nextx
  42. 360 a=2:b=16:goto220
  43. 400 printchr$(147):print" [200]ow many players (1-4)?[160]";
  44. 410 poke198,0:wait198,1:getp$:p=val(p$)
  45. 450 printchr$(147)
  46. 455 ifp<1orp>4goto400
  47. 500 forx=1to16:readsu$(x):nextx
  48. 550 ra=int(16*rnd(1))+1:x=ra:gosub11
  49. 555 print" [217]ou are the detective on the midnight":print
  50. 558 print" shift at the station.  [217]ou get an":print
  51. 560 print" anonymous phone call........."
  52. 561 gosub50000:rem phone ringing
  53. 563 print:print:print
  54. 564 print" [212]he caller says there is going to be":print
  55. 566 print" trouble in town.  [217]ou drive into town":print
  56. 568 print" and find..........."
  57. 570 poke781,23:poke782,6:sys65520:printpr$;
  58. 572 poke198,0:wait198,1:getkey$:printchr$(147)
  59. 575 gosub50100:rem gunshot
  60. 600 print" "su$(ra)"[160]has been murdered!"
  61. 610 poke781,23:poke782,6:sys65520:printpr$;
  62. 620 poke198,0:wait198,1:getkey$
  63. 622 printchr$(147):poke781,1:poke782,1:sys65520:
  64. 624 print"[208]lease have a seat while [201] gather the   suspects...."
  65. 630 foraa=1top:an$(aa,ra,1)="[196][197][193][196]":nextaa
  66. 640 foraa=1top:si(aa,ra)=1:nextaa
  67. 650 print
  68. 800 su(ra)=0
  69. 810 ra=int(16*rnd(1)+1)
  70. 820 ifsu(ra)=1then810
  71. 825 mu=ra
  72. 830 ifmu<9thenms$="[205]ale":goto850
  73. 840 ms$="[198]emale"
  74. 850 forx=1to4
  75. 900 ra=int(2*rnd(1)+1):ew(x)=ra
  76. 950 gosub15
  77. 1000 nextx
  78. 1004 ifew(1)+ew(2)+ew(3)+ew(4)=4goto850
  79. 1005 ifew(1)+ew(2)+ew(3)+ew(4)=8goto850
  80. 1010 ra=int(2*rnd(1)+1):ifra=1thenwe=3:we$=".357":goto1050
  81. 1020 we=4:we$=".44"
  82. 1050 forx=1to4
  83. 1100 ra=int(3*rnd(1)+1):ar(x)=ra
  84. 1150 gosub17
  85. 1200 nextx
  86. 1300 forx=1to4:d(x)=0:next
  87. 1310 forx=3to4
  88. 1320 ra=int(4*rnd(1)+1)
  89. 1330 ifd(ra)=1goto1320
  90. 1340 wl(x)=ra:d(ra)=1
  91. 1350 ifwl(x)=1thenwl$(x)="[212]avern"
  92. 1360 ifwl(x)=2thenwl$(x)="[195]afe"
  93. 1370 ifwl(x)=3thenwl$(x)="[197]mbassy"
  94. 1380 ifwl(x)=4thenwl$(x)="[196]ocks"
  95. 1390 nextx
  96. 1800 cc=0
  97. 1999 win=-2
  98. 2000 pl=0:win=win+2
  99. 2010 pl=pl+1
  100. 2020 ifpl=p+1goto2000
  101. 2025 ifout(1)+out(2)+out(3)+out(4)=pthengoto26000
  102. 2027 ifout(pl)<>1then2090
  103. 2030 ifout(pl)=1thenprintchr$(147);"      [208]layer #"pl"is out of the game."
  104. 2040 poke781,23:poke782,6:sys65520:printpr$;
  105. 2050 poke198,0:wait198,1:getkey$:goto2010
  106. 2090 print
  107. 2092 rem sound of bell
  108. 2095 printchr$(147):poke781,11:poke782,14:sys65520:print" [208]layer #"pl
  109. 2096 poke781,23:poke782,6:sys65520:printpr$:poke198,0:wait198,1:getkey$
  110. 2097 qq=2
  111. 2098 gosub12000
  112. 2200 printchr$(147):printsu$(x):print
  113. 2350 nq=0
  114. 2400 ifx<6thengosub40000
  115. 2410 ifx>5andx<11thengosub40020
  116. 2420 ifx>10thengosub40040
  117. 2430 ifx<>1andx<>3andx<>5andx<>13andx<>15thengosub40060
  118. 2440 ifx<>2andx<>4andx<>12andx<>14andx<>16thengosub40070
  119. 2450 ifx<6orx>11thengosub40080
  120. 2460 gosub40090
  121. 2505 ifqq=1goto2590
  122. 2510 poke781,18:poke782,0:sys65520
  123. 2511 printchr$(18);"[201]s this the right suspect (y/n)?[160]";
  124. 2520 poke198,0:wait198,1:getyn$:printyn$:printyn$
  125. 2530 ifyn$="n"thenqq=0:goto2098
  126. 2533 poke781,18:poke782,0:sys65520
  127. 2590 qq=0:goto2675
  128. 2630 qq=0
  129. 2631 poke781,23:poke782,6:sys65520:printpr$;
  130. 2632 poke198,0:wait198,1:getkey$:print
  131. 2633 poke781,18:poke782,0:sys65520
  132. 2634 forzz=1to6:print""sp$"[151]":next
  133. 2637 ifnq<2thengoto2675
  134. 2640 ifnq>=2thengoto2010
  135. 2675 poke781,18:poke782,0:sys65520
  136. 2680 print"[215]hich personal question would you like"
  137. 2681 input"to ask?[160]([197]nter 0 for crime sheet)";pq$:pq=val(pq$):print
  138. 2683 ifpq$=""thengoto2675
  139. 2685 ifpq<0orpq>11then24600
  140. 2690 ifpq=0thenqq=1:gosub12000:x=xx:printchr$(18);su$(xx):goto2400
  141. 2691 ifxx=1 or xx=3 or xx=5goto24000
  142. 2692 ifxx=2 or xx=4goto24100
  143. 2693 ifxx>5and xx<11goto24200
  144. 2694 ifxx=11goto24300
  145. 2695 ifxx=12orxx=14orxx=16goto24400
  146. 2696 goto24500
  147. 2699 nq=nq+1
  148. 2700 ifpq=1thenx=mu:gosub11:printsi$:an$(pl,17,2)=si$:goto2630
  149. 2800 ifpq=2thenprintms$:an$(pl,17,5)=ms$:gosub41000:goto2630
  150. 2900 ifpq=3thenx=mu:gosub11:printtwn$+tn$:an$(pl,17,3)=twn$:goto2630
  151. 3000 ifpq=4thenprintwe$:an$(pl,17,4)=we$:goto2630
  152. 3100 ifpq=5andan$(pl,17,4)<>""thenprintwl$(we):an$(pl,17,6)=wl$(we):goto2630
  153. 3200 ifpq=5then5000
  154. 3250 ifpq=6thenx=mu:gosub11:printloc$:an$(pl,17,1)=loc$:goto2630
  155. 3300 ifpq=7thenx=xx:gosub11:printsi$:an$(pl,x,2)=si$:goto2630
  156. 3400 ifpq=8thenx=xx:gosub11:printtwn$+tn$:an$(pl,x,3)=twn$:goto2630
  157. 3500 ifpq=9thenx=xx:gosub11:printloc$:an$(pl,x,1)=loc$:goto2630
  158. 3600 ifpq=9goto2630
  159. 3700 ifpq=10thenx=xx:ifsu(x)=wl(we)thenprint"[217]es":an$(pl,x,4)="[217]es":goto2630
  160. 3800 ifpq=10thenprint"[206]o":an$(pl,x,4)="[206]o":goto2630
  161. 3900 ifpq=11andan$(pl,17,4)<>""thenx=xx:gosub43000:ifvv=1thenvv=0:goto2631
  162. 3910 ifpq=11andan$(pl,17,4)<>""thenprintfp$:an$(pl,17,7)=fp$:goto2631
  163. 5000 print"[217]ou don't know the weapon yet.":nq=nq-1:goto2631
  164. 12000 printchr$(147)
  165. 12010 poke781,1:poke782,34:sys65520:print"with"
  166. 12030 poke781,2:poke782,34:sys65520:print"murder"
  167. 12040 poke781,3:poke782,0:sys65520:print"#"
  168. 12050 poke781,3:poke782,4:sys65520:print"suspect"
  169. 12060 poke781,3:poke782,16:sys65520:print"place"
  170. 12070 poke781,3:poke782,24:sys65520:print"side"
  171. 12080 poke781,3:poke782,29:sys65520:print"town"
  172. 12090 poke781,3:poke782,34:sys65520:print"weapon"
  173. 12100 aa=2:poke781,4:poke782,0:sys65520:gosub21
  174. 12110 aa=11:poke781,4:poke782,3:sys65520:gosub21
  175. 12120 aa=8:poke781,4:poke782,15:sys65520:gosub21
  176. 12130 aa=4:poke781,4:poke782,24:sys65520:gosub21
  177. 12140 aa=4:poke781,4:poke782,29:sys65520:gosub21
  178. 12150 aa=6:poke781,4:poke782,34:sys65520:gosub21
  179. 12152 forco=1to16
  180. 12154 ifan$(pl,co,4)="[217]es"andan$(pl,17,6)<>""thenan$(pl,co,1)=an$(pl,17,6)
  181. 12156 ifan$(pl,co,4)="[217]es"andan$(pl,co,1)<>""thenan$(pl,17,6)=an$(pl,co,1)
  182. 12158 nextco
  183. 12160 foraa=1to3
  184. 12165 ifan$(pl,17,aa)<>""thengosub21000
  185. 12170 nextaa
  186. 12175 forco=1to16
  187. 12180 ifan$(pl,co,1)=""goto12195
  188. 12183 foraa=co+1to17
  189. 12185 ifan$(pl,co,1)=an$(pl,aa,1)thengoto12190
  190. 12190 nextaa
  191. 12195 nextco
  192. 12196 rem ***** print suspect in inverse if innocent ****
  193. 12200 forbb=1to16
  194. 12210 ifsi(pl,bb)=1then goto 12225
  195. 12220 poke781,bb+3:poke782,0:printbb;su$(bb):goto12230
  196. 12225 printchr$(18);:poke781,bb+3:poke782,0:printbb;su$(bb)
  197. 12230 next
  198. 12300 poke781,21:poke782,0:sys65520:print"[205]urderer: "
  199. 12350 poke781,22:poke782,0:sys65520:print"[211]ex: "
  200. 12400 poke781,23:poke782,0:sys65520:print"[208]lace of murder weapon:[160]"
  201. 12450 poke781,24:poke782,0:sys65520:print"[207]dd or even fingerprints on weapon: ";
  202. 18000 cc=0
  203. 18050 fordd=1to4
  204. 18100 forbb=1to17
  205. 18150 poke781,bb+4:poke782,cc+17:sys65520:printan$(pl,bb,dd)
  206. 18200 nextbb
  207. 18240 poke781,22:poke782,5:sys65520:printchr$(18);an$(pl,17,5)
  208. 18250 ifcc=0thencc=8:goto18400
  209. 18300 ifcc=8thencc=13:goto18400
  210. 18350 cc=18
  211. 18400 nextdd
  212. 18430 poke781,23:poke782,24:sys65520:printchr$(18);an$(pl,17,6)
  213. 18440 poke781,24:poke782,35:sys65520:printchr$(18);an$(pl,17,7);
  214. 18950 poke781,0:poke782,0:sys65520
  215. 18955 ifqq=0then18968
  216. 18960 ifqq=1thenprintpr$;:poke189,0:wait198,1:getkey$:printchr$(147):return
  217. 18965 ifqq=2thenprint"[196]o y