home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 2
/
002.d81
/
detective!
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
10KB
|
349 lines
1 rem adapted from apple detective by larry jasonwicz
2 poke783,peek(783)and254
6 poke53272,23:poke53280,13:poke53281,1:printchr$(151)
10 goto82
11 ifsu(x)=1thenloc$="[212]avern":si$=ew$(1):twn$=ar$(1):return
12 ifsu(x)=2thenloc$="[195]afe":si$=ew$(2):twn$=ar$(2):return
13 ifsu(x)=3thenloc$="[197]mbassy":si$=ew$(3):twn$=ar$(3):return
14 loc$="[196]ocks":si$=ew$(4):twn$=ar$(4):return
15 ifew(x)=1then ew$(x)="[197]ast":return
16 ew$(x)="[215]est":return
17 tn$="[212]own"
18 ifar(x)=1thenar$(x)="[213]p":return
19 ifar(x)=2thenar$(x)="[205]id":return
20 ar$(x)="[196]own":return
21 forbb=1toaa:print"-";:next:return
22 fori=1to4:d(i)=0:next:y=0:return
82 printchr$(147):gosub45000
90 poke781,23:poke782,4:sys65520:print" [196]o you want instructions (y/n)?[160]";
91 poke198,0:wait198,1:getny$
92 ifny$="n"then100
93 ifny$="y"then95
94 goto90
95 print"[147]load"chr$(34)"det.instructions"chr$(34)",8":print"run"
96 poke631,13:poke632,13:poke198,2:end
100 dimsu$(17),su(17),loc$(17),an$(5,18,8),si(5,18)
101 pr$="[208]ress <space bar> to continue."
102 yo$="[217]ou don't know the weapon location yet."
103 s1$="[217]ou don't know if this suspect was at"
104 s2$="the place of the murder weapon."
105 sp$=" "
110 printchr$(147)
200 a=1:b=15
220 gosub22
240 forx=atobstep2
260 ra=int(4*rnd(1)+1)
265 z=int(rnd(1)*23)+1:zz=int(rnd(1)*39)+1:poke781,z:poke782,zz:sys65520:print"*"
280 ifd(ra)=1goto260
300 su(x)=ra
320 d(ra)=1:y=y+1:ify=4thengosub22
330 ifx=16goto400
340 nextx
360 a=2:b=16:goto220
400 printchr$(147):print" [200]ow many players (1-4)?[160]";
410 poke198,0:wait198,1:getp$:p=val(p$)
450 printchr$(147)
455 ifp<1orp>4goto400
500 forx=1to16:readsu$(x):nextx
550 ra=int(16*rnd(1))+1:x=ra:gosub11
555 print" [217]ou are the detective on the midnight":print
558 print" shift at the station. [217]ou get an":print
560 print" anonymous phone call........."
561 gosub50000:rem phone ringing
563 print:print:print
564 print" [212]he caller says there is going to be":print
566 print" trouble in town. [217]ou drive into town":print
568 print" and find..........."
570 poke781,23:poke782,6:sys65520:printpr$;
572 poke198,0:wait198,1:getkey$:printchr$(147)
575 gosub50100:rem gunshot
600 print" "su$(ra)"[160]has been murdered!"
610 poke781,23:poke782,6:sys65520:printpr$;
620 poke198,0:wait198,1:getkey$
622 printchr$(147):poke781,1:poke782,1:sys65520:
624 print"[208]lease have a seat while [201] gather the suspects...."
630 foraa=1top:an$(aa,ra,1)="[196][197][193][196]":nextaa
640 foraa=1top:si(aa,ra)=1:nextaa
650 print
800 su(ra)=0
810 ra=int(16*rnd(1)+1)
820 ifsu(ra)=1then810
825 mu=ra
830 ifmu<9thenms$="[205]ale":goto850
840 ms$="[198]emale"
850 forx=1to4
900 ra=int(2*rnd(1)+1):ew(x)=ra
950 gosub15
1000 nextx
1004 ifew(1)+ew(2)+ew(3)+ew(4)=4goto850
1005 ifew(1)+ew(2)+ew(3)+ew(4)=8goto850
1010 ra=int(2*rnd(1)+1):ifra=1thenwe=3:we$=".357":goto1050
1020 we=4:we$=".44"
1050 forx=1to4
1100 ra=int(3*rnd(1)+1):ar(x)=ra
1150 gosub17
1200 nextx
1300 forx=1to4:d(x)=0:next
1310 forx=3to4
1320 ra=int(4*rnd(1)+1)
1330 ifd(ra)=1goto1320
1340 wl(x)=ra:d(ra)=1
1350 ifwl(x)=1thenwl$(x)="[212]avern"
1360 ifwl(x)=2thenwl$(x)="[195]afe"
1370 ifwl(x)=3thenwl$(x)="[197]mbassy"
1380 ifwl(x)=4thenwl$(x)="[196]ocks"
1390 nextx
1800 cc=0
1999 win=-2
2000 pl=0:win=win+2
2010 pl=pl+1
2020 ifpl=p+1goto2000
2025 ifout(1)+out(2)+out(3)+out(4)=pthengoto26000
2027 ifout(pl)<>1then2090
2030 ifout(pl)=1thenprintchr$(147);" [208]layer #"pl"is out of the game."
2040 poke781,23:poke782,6:sys65520:printpr$;
2050 poke198,0:wait198,1:getkey$:goto2010
2090 print
2092 rem sound of bell
2095 printchr$(147):poke781,11:poke782,14:sys65520:print" [208]layer #"pl
2096 poke781,23:poke782,6:sys65520:printpr$:poke198,0:wait198,1:getkey$
2097 qq=2
2098 gosub12000
2200 printchr$(147):printsu$(x):print
2350 nq=0
2400 ifx<6thengosub40000
2410 ifx>5andx<11thengosub40020
2420 ifx>10thengosub40040
2430 ifx<>1andx<>3andx<>5andx<>13andx<>15thengosub40060
2440 ifx<>2andx<>4andx<>12andx<>14andx<>16thengosub40070
2450 ifx<6orx>11thengosub40080
2460 gosub40090
2505 ifqq=1goto2590
2510 poke781,18:poke782,0:sys65520
2511 printchr$(18);"[201]s this the right suspect (y/n)?[160]";
2520 poke198,0:wait198,1:getyn$:printyn$:printyn$
2530 ifyn$="n"thenqq=0:goto2098
2533 poke781,18:poke782,0:sys65520
2590 qq=0:goto2675
2630 qq=0
2631 poke781,23:poke782,6:sys65520:printpr$;
2632 poke198,0:wait198,1:getkey$:print
2633 poke781,18:poke782,0:sys65520
2634 forzz=1to6:print""sp$"[151]":next
2637 ifnq<2thengoto2675
2640 ifnq>=2thengoto2010
2675 poke781,18:poke782,0:sys65520
2680 print"[215]hich personal question would you like"
2681 input"to ask?[160]([197]nter 0 for crime sheet)";pq$:pq=val(pq$):print
2683 ifpq$=""thengoto2675
2685 ifpq<0orpq>11then24600
2690 ifpq=0thenqq=1:gosub12000:x=xx:printchr$(18);su$(xx):goto2400
2691 ifxx=1 or xx=3 or xx=5goto24000
2692 ifxx=2 or xx=4goto24100
2693 ifxx>5and xx<11goto24200
2694 ifxx=11goto24300
2695 ifxx=12orxx=14orxx=16goto24400
2696 goto24500
2699 nq=nq+1
2700 ifpq=1thenx=mu:gosub11:printsi$:an$(pl,17,2)=si$:goto2630
2800 ifpq=2thenprintms$:an$(pl,17,5)=ms$:gosub41000:goto2630
2900 ifpq=3thenx=mu:gosub11:printtwn$+tn$:an$(pl,17,3)=twn$:goto2630
3000 ifpq=4thenprintwe$:an$(pl,17,4)=we$:goto2630
3100 ifpq=5andan$(pl,17,4)<>""thenprintwl$(we):an$(pl,17,6)=wl$(we):goto2630
3200 ifpq=5then5000
3250 ifpq=6thenx=mu:gosub11:printloc$:an$(pl,17,1)=loc$:goto2630
3300 ifpq=7thenx=xx:gosub11:printsi$:an$(pl,x,2)=si$:goto2630
3400 ifpq=8thenx=xx:gosub11:printtwn$+tn$:an$(pl,x,3)=twn$:goto2630
3500 ifpq=9thenx=xx:gosub11:printloc$:an$(pl,x,1)=loc$:goto2630
3600 ifpq=9goto2630
3700 ifpq=10thenx=xx:ifsu(x)=wl(we)thenprint"[217]es":an$(pl,x,4)="[217]es":goto2630
3800 ifpq=10thenprint"[206]o":an$(pl,x,4)="[206]o":goto2630
3900 ifpq=11andan$(pl,17,4)<>""thenx=xx:gosub43000:ifvv=1thenvv=0:goto2631
3910 ifpq=11andan$(pl,17,4)<>""thenprintfp$:an$(pl,17,7)=fp$:goto2631
5000 print"[217]ou don't know the weapon yet.":nq=nq-1:goto2631
12000 printchr$(147)
12010 poke781,1:poke782,34:sys65520:print"with"
12030 poke781,2:poke782,34:sys65520:print"murder"
12040 poke781,3:poke782,0:sys65520:print"#"
12050 poke781,3:poke782,4:sys65520:print"suspect"
12060 poke781,3:poke782,16:sys65520:print"place"
12070 poke781,3:poke782,24:sys65520:print"side"
12080 poke781,3:poke782,29:sys65520:print"town"
12090 poke781,3:poke782,34:sys65520:print"weapon"
12100 aa=2:poke781,4:poke782,0:sys65520:gosub21
12110 aa=11:poke781,4:poke782,3:sys65520:gosub21
12120 aa=8:poke781,4:poke782,15:sys65520:gosub21
12130 aa=4:poke781,4:poke782,24:sys65520:gosub21
12140 aa=4:poke781,4:poke782,29:sys65520:gosub21
12150 aa=6:poke781,4:poke782,34:sys65520:gosub21
12152 forco=1to16
12154 ifan$(pl,co,4)="[217]es"andan$(pl,17,6)<>""thenan$(pl,co,1)=an$(pl,17,6)
12156 ifan$(pl,co,4)="[217]es"andan$(pl,co,1)<>""thenan$(pl,17,6)=an$(pl,co,1)
12158 nextco
12160 foraa=1to3
12165 ifan$(pl,17,aa)<>""thengosub21000
12170 nextaa
12175 forco=1to16
12180 ifan$(pl,co,1)=""goto12195
12183 foraa=co+1to17
12185 ifan$(pl,co,1)=an$(pl,aa,1)thengoto12190
12190 nextaa
12195 nextco
12196 rem ***** print suspect in inverse if innocent ****
12200 forbb=1to16
12210 ifsi(pl,bb)=1then goto 12225
12220 poke781,bb+3:poke782,0:printbb;su$(bb):goto12230
12225 printchr$(18);:poke781,bb+3:poke782,0:printbb;su$(bb)
12230 next
12300 poke781,21:poke782,0:sys65520:print"[205]urderer: "
12350 poke781,22:poke782,0:sys65520:print"[211]ex: "
12400 poke781,23:poke782,0:sys65520:print"[208]lace of murder weapon:[160]"
12450 poke781,24:poke782,0:sys65520:print"[207]dd or even fingerprints on weapon: ";
18000 cc=0
18050 fordd=1to4
18100 forbb=1to17
18150 poke781,bb+4:poke782,cc+17:sys65520:printan$(pl,bb,dd)
18200 nextbb
18240 poke781,22:poke782,5:sys65520:printchr$(18);an$(pl,17,5)
18250 ifcc=0thencc=8:goto18400
18300 ifcc=8thencc=13:goto18400
18350 cc=18
18400 nextdd
18430 poke781,23:poke782,24:sys65520:printchr$(18);an$(pl,17,6)
18440 poke781,24:poke782,35:sys65520:printchr$(18);an$(pl,17,7);
18950 poke781,0:poke782,0:sys65520
18955 ifqq=0then18968
18960 ifqq=1thenprintpr$;:poke189,0:wait198,1:getkey$:printchr$(147):return
18965 ifqq=2thenprint"[196]o y