home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1993 October
/
1993-10.d64
/
bowling
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
6KB
|
187 lines
0 rem copyright 1993 compute publications intl ltd - all rights reserved
5 clr:gosub50:forx=ato700:ready:pokex,y:next:poke53280,.:poke53281,.
10 dv=8:rem dev # is 8
15 print"[147]"spc(14)"[159]bowling menu":print"1[156] chg names"rt$"2[156] chg dates
20 [153]"3clr chg scores"rt$"4clr summary"rt$"5clr start new file"rt$"6clr load
25 print"7[156] save"rt$"8[156] print"rt$"9[156] exit
30 ln[178]15:[141]75:x$[178]"":[158]a,.,15:[153]"well?"
35 [146]198,15:[161]x$:[139]x$[179]"1"[176]x$[177]"9"[167]30
40 [145][197](x$)[141]635,650,250,675,50,165,165,530,665:[137]15
45 [158]a,16,23:[153]"syshit a key":[146]198,15:[161]x$:[142]
50 [151]49,[194](47):[151]50,[194](48):rt$[178][199](13)
55 a[178]679:nw[178]40:nb[178]7:[134]x$,x,y,bn,wn,ln,f$,z$,z,w2,xx,nm$,tp,tg
60 [134]hg,lg,hs,ls,s1,s2,s3,s4,s5,s6,s8,g1,g2,g3,g4,g5
65 [134]dt$(nw),tp%(nb,nw),tg%(nb,nw),g1%(nb,nw),g2%(nb,nw),g3%(nb,nw)
70 p$[178]" ":c$[178]p$[170]p$:[142]
75 [151]781,ln:[158]59903:[142]
80 [141]120
85 x$[178]"":[133]"bowler";x$:[139]x$[178]""[167][142]
90 bn[178][197](x$):[139]bn[179]1[176]bn[177]nb[167]85
95 [142]
100 [141]125
105 x$[178]"":[133]"date";x$:[139]x$[178]""[167][142]
110 wn[178][197](x$):[139]wn[179]1[176]wn[177]nw[167]105
115 [142]
120 [153]"load":[129]x[178]1[164]nb:[153]" "x""nm$(x)"":[130]:[153]"":[142]
125 x[178]1:[153]"load
130 gosub140:ifx>nwthenreturn
135 goto130
140 forx=xtox+19:ifx>nwthenreturn
145 ifx>20thenprinttab(20);
150 ifx<10thenprint" ";
155 printx""dt$(x)"":next:print"":return
160 forx=1to999:next:ln=18:goto75
165 s$="":sysa,.,15:print"file "f$:input"[145]";s$:ifs$=""then30
170 ifx$="7"then230
175 b$=s$:open2,dv,2,b$+",p,r":close2:open15,dv,15:input#15,z,z$:close15
180 ifz=62thenprint"not found":gosub160:goto165
185 gosub50:f$=s$:s$=f$+",s,r":open8,dv,8,s$
190 forx=1tonw:input#8,dt$(x):next:forx=1tonb:input#8,nm$(x):fory=1tonw
195 input#8,g1%(x,y):input#8,g2%(x,y):input#8,g3%(x,y)
200 tp(x)=tp(x)+g1%(x,y)+g2%(x,y)+g3%(x,y):tp%(x,y)=tp(x)
205 ifg1%(x,y)>.thentg(x)=tg(x)+1
210 ifg2%(x,y)>.thentg(x)=tg(x)+1
215 ifg3%(x,y)>.thentg(x)=tg(x)+1
220 tg%(x,y)=tg(x)
225 goto245
230 f$=s$:s$="@0:"+f$+",s,w":open8,dv,8,s$
235 forx=1tonw:print#8,dt$(x):next:forx=1tonb:print#8,nm$(x):fory=1tonw
240 print#8,g1%(x,y);rt$;g2%(x,y);rt$;g3%(x,y)
245 next:next:close8:goto30
250 gosub80:ifx$=""thenreturn
255 gosub100:ifx$=""thenreturn
260 print"[147]
265 ln[178]1:[141]75:[153]"bowler "nm$(bn):[158]a,33,1:[153]"week"wn
270 ln[178]2:[141]75:[158]a,14,2:[153]"date "dt$(wn)
275 [158]a,.,4:[153]"sys game game game series prev curr total
280 print"[145] 1 2 3 total avg avg pins "
285 print"[158]1 chg game 1 [158]< prev date [158]w new date
290 [153]"sys2 chg game 2 sys> next date sysb new bowlr
295 print"[145][158]3 chg game 3 [158]p prev bowlr [158]c chg name
300 [153]"sysx exit sysn next bowlr sysk chg date
305 ln=7:gosub75:sysa,.,7:print"[159]"g1%(bn,wn):sysa,5,7:printg2%(bn,wn)
310 sysa,10,7:printg3%(bn,wn):xx=g1%(bn,wn)+g2%(bn,wn)+g3%(bn,wn)
315 sysa,16,7:printxx:w2=wn-1:iftg%(bn,w2)=.thenxx=.:goto325
320 xx=int(tp%(bn,w2)/tg%(bn,w2))
325 sysa,23,7:printxx:iftg%(bn,wn)=.thenxx=.:goto335
330 xx=int(tp%(bn,wn)/tg%(bn,wn))
335 sysa,29,7:printxx:tp%(bn,wn)=tp%(bn,w2)+g1%(bn,wn)+g2%(bn,wn)+g3%(bn,wn)
340 sysa,34,7:printtp%(bn,wn)
345 sysa,.,17:print"well?":wait198,15:getx$:ifx$="1"then415
350 ifx$="1"then415
355 ifx$="2"then430
360 ifx$="3"then445
365 ifx$="w"thengosub100:goto260
370 ifx$="b"thengosub80:goto260
375 ifx$="c"thengosub635
380 ifx$="k"thengosub650
385 ifx$="n"then500
390 ifx$="p"then490
395 ifx$="x"thenreturn
400 ifx$=","orx$="<"then510
405 ifx$="."orx$=">"then520
410 goto260
415 x$="":sysa,.,17:input"new score game 1";x$:ifx$=""then305
420 ifval(x$)<.orval(x$)>300then415
425 g1%(bn,wn)=val(x$):goto460
430 x$="":sysa,.,17:input"new score game 2";x$:ifx$=""then305
435 ifval(x$)<.orval(x$)>300then430
440 g2%(bn,wn)=val(x$):goto460
445 x$="":sysa,.,17:input"new score game 3";x$:ifx$=""then305
450 ifval(x$)<.orval(x$)>300then445
455 g3%(bn,wn)=val(x$)
460 w2=wn-1:xx=tg%(bn,w2):y=tp%(bn,w2):forx=wntonw
465 ifg1%(bn,x)>.thenxx=xx+1:y=y+g1%(bn,x)
470 ifg2%(bn,x)>.thenxx=xx+1:y=y+g2%(bn,x)
475 ifg3%(bn,x)>.thenxx=xx+1:y=y+g3%(bn,x)
480 tg%(bn,x)=xx:tp%(bn,x)=y:next:goto305
485 ifwn>nwthenwn=nw
490 bn=bn-1:ifbn=.thenbn=nb
495 goto260
500 bn=bn+1:ifbn>nbthenbn=1
505 goto260
510 wn=wn-1:ifwn=.thenwn=nw
515 goto260
520 wn=wn+1:ifwn>nwthenwn=1
525 goto260
530 open4,4,0:print#4," name wk date gm1 gm2 ";
535 print#4,"gm3 series avg tot pins games [146]":print#4
540 fory=1tonw:forx=1tonb
545 ifg1%(x,y)=.andg2%(x,y)=.andg3%(x,y)=.then630
550 ify<10thenxx=13-len(nm$(x))
555 ify>9thenxx=12-len(nm$(x))
560 print#4," "nm$(x)spc(xx);:ifx=1thenprint#4,y" "dt$(y)" ";:goto570
565 print#4,spc(16);
570 print#4,g1%(x,y)" "g2%(x,y)" "g3%(x,y);
575 print#4," ";:xx=g1%(x,y)+g2%(x,y)+g3%(x,y)
580 ifxx<10thenprint#4," ";
585 ifxx<100thenprint#4," ";
590 print#4,xx" ";:xx=int(tp%(x,y)/tg%(x,y)):print#4,xx" ";
595 iftp%(x,y)<10thenprint#4," ";
600 iftp%(x,y)<100thenprint#4," ";
605 iftp%(x,y)<1000thenprint#4," ";
610 iftp%(x,y)<10000thenprint#4," ";
615 print#4,tp%(x,y)" ";:iftg%(x,y)<10thenprint#4," ";
620 iftg%(x,y)<100thenprint#4," ";
625 print#4,tg%(x,y)
630 next:next:return
635 gosub80:ifx$=""thenreturn
640 x$="":ln=1:gosub75:input"new name";x$:ifx$=""then635
645 x$=left$(x$,16):nm$(bn)=x$:goto635
650 gosub100:ifx$=""thenreturn
655 x$="":ln=1:gosub75:input"new date";x$:ifx$=""then650
660 x$=left$(x$,16):dt$(wn)=x$:goto650
665 x$="":sysa,.,15:print"exit?":wait198,15:getx$:ifx$="y"thensys64738
670 return
675 gosub80:ifx$=""thenreturn
680 print"[147][159]"spc(17)"summary
685 hg[178].:lg[178]300:hs[178].:ls[178]900:s1[178].:s2[178].:s3[178].:s4[178].:s5[178].:s6[178].:s7[178].:s8[178].:g1[178].:g2[178].
690 g3[178].:g4[178].:g5[178].:x[178]bn
695 [153]""p$"bowler"p$nm$(bn):[129]y[178]1[164]nw
700 [139]g1%(x,y)[177]hg[167]hg[178]g1%(x,y)
705 [139]g2%(x,y)[177]hg[167]hg[178]g2%(x,y)
710 [139]g3%(x,y)[177]hg[167]hg[178]g3%(x,y)
715 [139]g1%(x,y)[179]lg[175]g1%(x,y)[177].[167]lg[178]g1%(x,y)
720 [139]g2%(x,y)[179]lg[175]g2%(x,y)[177].[167]lg[178]g2%(x,y)
725 [139]g3%(x,y)[179]lg[175]g3%(x,y)[177].[167]lg[178]g3%(x,y)
730 tg[178]g1%(x,y)[170]g2%(x,y)[170]g3%(x,y)
735 [139]tg[177]hs[167]hs[178]tg
740 [139]tg[179]ls[175]tg[177].[167]ls[178]tg
745 [139]tg[177]849[167]s8[178]s8[170]1:[137]785
750 [139]tg[177]799[167]s7[178]s7[170]1:[137]785
755 [139]tg[177]749[167]s6[178]s6[170]1:[137]785
760 [139]tg[177]699[167]s5[178]s5[170]1:[137]785
765 [139]tg[177]649[167]s4[178]s4[170]1:[137]785
770 [139]tg[177]599[167]s3[178]s3[170]1:[137]785
775 [139]tg[177]549[167]s2[178]s2[170]1:[137]785
780 [139]tg[177]499[167]s1[178]s1[170]1
785 [139]g1%(x,y)[177]299[167]g5[178]g5[170]1:[137]810
790 [139]g1%(x,y)[177]274[167]g4[178]g4[170]1:[137]810
795 [139]g1%(x,y)[177]249[167]g3[178]g3[170]1:[137]810
800 [139]g1%(x,y)[177]224[167]g2[178]g2[170]1:[137]810
805 [139]g1%(x,y)[177]199[167]g1[178]g1[170]1
810 [139]g2%(x,y)[177]299[167]g5[178]g5[170]1:[137]835
815 [139]g2%(x,y)[177]274[167]g4[178]g4[170]1:[137]835
820 [139]g2%(x,y)[177]249[167]g3[178]g3[170]1:[137]835
825 [139]g2%(x,y)[177]224[167]g2[178]g2[170]1:[137]835
830 [139]g2%(x,y)[177]199[167]g1[178]g1[170]1
835 [139]g3%(x,y)[177]299[167]g5[178]g5[170]1:[137]860
840 [139]g3%(x,y)[177]274[167]g4[178]g4[170]1:[137]860
845 [139]g3%(x,y)[177]249[167]g3[178]g3[170]1:[137]860
850 [139]g3%(x,y)[177]224[167]g2[178]g2[170]1:[137]860
855 [139]g3%(x,y)[177]199[167]g1[178]g1[170]1
860 [130]:[139]tg%(x,40)[178].[167]xx[178].:[137]870
865 xx[178][181](tp%(x,40)[173]tg%(x,40))
870 [153]p$"current avg "xx
875 [153]p$"high game "hg;rt$p$"low game "lg
880 [153]p$"high series "hs;rt$p$"low series "ls
885 [153]p$"200 games "g1;rt$p$"225 games "g2
890 [153]p$"250 games "g3;rt$p$"275 games "g4
895 [153]p$"300 games "g5
900 [153]p$"500 series "s1;rt$p$"550 series "s2
905 [153]p$"600 series "s3;rt$p$"650 series "s4
910 [153]p$"700 series "s5;r