home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1993 October / 1993-10.d64 / bowling (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  6KB  |  187 lines

  1. 0 rem copyright 1993 compute publications intl ltd - all rights reserved
  2. 5 clr:gosub50:forx=ato700:ready:pokex,y:next:poke53280,.:poke53281,.
  3. 10 dv=8:rem dev # is 8
  4. 15 print"[147]"spc(14)"[159]bowling menu":print"1[156] chg names"rt$"2[156] chg dates
  5. 20 [153]"3clr chg scores"rt$"4clr summary"rt$"5clr start new file"rt$"6clr load
  6. 25 print"7[156] save"rt$"8[156] print"rt$"9[156] exit
  7. 30 ln[178]15:[141]75:x$[178]"":[158]a,.,15:[153]"well?"
  8. 35 [146]198,15:[161]x$:[139]x$[179]"1"[176]x$[177]"9"[167]30
  9. 40 [145][197](x$)[141]635,650,250,675,50,165,165,530,665:[137]15
  10. 45 [158]a,16,23:[153]"syshit a key":[146]198,15:[161]x$:[142]
  11. 50 [151]49,[194](47):[151]50,[194](48):rt$[178][199](13)
  12. 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
  13. 60 [134]hg,lg,hs,ls,s1,s2,s3,s4,s5,s6,s8,g1,g2,g3,g4,g5
  14. 65 [134]dt$(nw),tp%(nb,nw),tg%(nb,nw),g1%(nb,nw),g2%(nb,nw),g3%(nb,nw)
  15. 70 p$[178]"          ":c$[178]p$[170]p$:[142]
  16. 75 [151]781,ln:[158]59903:[142]
  17. 80 [141]120
  18. 85 x$[178]"":[133]"bowler";x$:[139]x$[178]""[167][142]
  19. 90 bn[178][197](x$):[139]bn[179]1[176]bn[177]nb[167]85
  20. 95 [142]
  21. 100 [141]125
  22. 105 x$[178]"":[133]"date";x$:[139]x$[178]""[167][142]
  23. 110 wn[178][197](x$):[139]wn[179]1[176]wn[177]nw[167]105
  24. 115 [142]
  25. 120 [153]"load":[129]x[178]1[164]nb:[153]" "x""nm$(x)"":[130]:[153]"":[142]
  26. 125 x[178]1:[153]"load
  27. 130 gosub140:ifx>nwthenreturn
  28. 135 goto130
  29. 140 forx=xtox+19:ifx>nwthenreturn
  30. 145 ifx>20thenprinttab(20);
  31. 150 ifx<10thenprint" ";
  32. 155 printx""dt$(x)"":next:print"":return
  33. 160 forx=1to999:next:ln=18:goto75
  34. 165 s$="":sysa,.,15:print"file  "f$:input"[145]";s$:ifs$=""then30
  35. 170 ifx$="7"then230
  36. 175 b$=s$:open2,dv,2,b$+",p,r":close2:open15,dv,15:input#15,z,z$:close15
  37. 180 ifz=62thenprint"not found":gosub160:goto165
  38. 185 gosub50:f$=s$:s$=f$+",s,r":open8,dv,8,s$
  39. 190 forx=1tonw:input#8,dt$(x):next:forx=1tonb:input#8,nm$(x):fory=1tonw
  40. 195 input#8,g1%(x,y):input#8,g2%(x,y):input#8,g3%(x,y)
  41. 200 tp(x)=tp(x)+g1%(x,y)+g2%(x,y)+g3%(x,y):tp%(x,y)=tp(x)
  42. 205 ifg1%(x,y)>.thentg(x)=tg(x)+1
  43. 210 ifg2%(x,y)>.thentg(x)=tg(x)+1
  44. 215 ifg3%(x,y)>.thentg(x)=tg(x)+1
  45. 220 tg%(x,y)=tg(x)
  46. 225 goto245
  47. 230 f$=s$:s$="@0:"+f$+",s,w":open8,dv,8,s$
  48. 235 forx=1tonw:print#8,dt$(x):next:forx=1tonb:print#8,nm$(x):fory=1tonw
  49. 240 print#8,g1%(x,y);rt$;g2%(x,y);rt$;g3%(x,y)
  50. 245 next:next:close8:goto30
  51. 250 gosub80:ifx$=""thenreturn
  52. 255 gosub100:ifx$=""thenreturn
  53. 260 print"[147]
  54. 265 ln[178]1:[141]75:[153]"bowler "nm$(bn):[158]a,33,1:[153]"week"wn
  55. 270 ln[178]2:[141]75:[158]a,14,2:[153]"date "dt$(wn)
  56. 275 [158]a,.,4:[153]"sys game game game series prev  curr  total
  57. 280 print"[145]  1    2    3   total   avg   avg  pins "
  58. 285 print"[158]1 chg game 1   [158]< prev date   [158]w new date
  59. 290 [153]"sys2 chg game 2   sys> next date   sysb new bowlr
  60. 295 print"[145][158]3 chg game 3   [158]p prev bowlr  [158]c chg name
  61. 300 [153]"sysx exit         sysn next bowlr  sysk chg date
  62. 305 ln=7:gosub75:sysa,.,7:print"[159]"g1%(bn,wn):sysa,5,7:printg2%(bn,wn)
  63. 310 sysa,10,7:printg3%(bn,wn):xx=g1%(bn,wn)+g2%(bn,wn)+g3%(bn,wn)
  64. 315 sysa,16,7:printxx:w2=wn-1:iftg%(bn,w2)=.thenxx=.:goto325
  65. 320 xx=int(tp%(bn,w2)/tg%(bn,w2))
  66. 325 sysa,23,7:printxx:iftg%(bn,wn)=.thenxx=.:goto335
  67. 330 xx=int(tp%(bn,wn)/tg%(bn,wn))
  68. 335 sysa,29,7:printxx:tp%(bn,wn)=tp%(bn,w2)+g1%(bn,wn)+g2%(bn,wn)+g3%(bn,wn)
  69. 340 sysa,34,7:printtp%(bn,wn)
  70. 345 sysa,.,17:print"well?":wait198,15:getx$:ifx$="1"then415
  71. 350 ifx$="1"then415
  72. 355 ifx$="2"then430
  73. 360 ifx$="3"then445
  74. 365 ifx$="w"thengosub100:goto260
  75. 370 ifx$="b"thengosub80:goto260
  76. 375 ifx$="c"thengosub635
  77. 380 ifx$="k"thengosub650
  78. 385 ifx$="n"then500
  79. 390 ifx$="p"then490
  80. 395 ifx$="x"thenreturn
  81. 400 ifx$=","orx$="<"then510
  82. 405 ifx$="."orx$=">"then520
  83. 410 goto260
  84. 415 x$="":sysa,.,17:input"new score game 1";x$:ifx$=""then305
  85. 420 ifval(x$)<.orval(x$)>300then415
  86. 425 g1%(bn,wn)=val(x$):goto460
  87. 430 x$="":sysa,.,17:input"new score game 2";x$:ifx$=""then305
  88. 435 ifval(x$)<.orval(x$)>300then430
  89. 440 g2%(bn,wn)=val(x$):goto460
  90. 445 x$="":sysa,.,17:input"new score game 3";x$:ifx$=""then305
  91. 450 ifval(x$)<.orval(x$)>300then445
  92. 455 g3%(bn,wn)=val(x$)
  93. 460 w2=wn-1:xx=tg%(bn,w2):y=tp%(bn,w2):forx=wntonw
  94. 465 ifg1%(bn,x)>.thenxx=xx+1:y=y+g1%(bn,x)
  95. 470 ifg2%(bn,x)>.thenxx=xx+1:y=y+g2%(bn,x)
  96. 475 ifg3%(bn,x)>.thenxx=xx+1:y=y+g3%(bn,x)
  97. 480 tg%(bn,x)=xx:tp%(bn,x)=y:next:goto305
  98. 485 ifwn>nwthenwn=nw
  99. 490 bn=bn-1:ifbn=.thenbn=nb
  100. 495 goto260
  101. 500 bn=bn+1:ifbn>nbthenbn=1
  102. 505 goto260
  103. 510 wn=wn-1:ifwn=.thenwn=nw
  104. 515 goto260
  105. 520 wn=wn+1:ifwn>nwthenwn=1
  106. 525 goto260
  107. 530 open4,4,0:print#4," name         wk    date      gm1   gm2   ";
  108. 535 print#4,"gm3   series   avg   tot pins   games [146]":print#4
  109. 540 fory=1tonw:forx=1tonb
  110. 545 ifg1%(x,y)=.andg2%(x,y)=.andg3%(x,y)=.then630
  111. 550 ify<10thenxx=13-len(nm$(x))
  112. 555 ify>9thenxx=12-len(nm$(x))
  113. 560 print#4," "nm$(x)spc(xx);:ifx=1thenprint#4,y" "dt$(y)"  ";:goto570
  114. 565 print#4,spc(16);
  115. 570 print#4,g1%(x,y)" "g2%(x,y)" "g3%(x,y);
  116. 575 print#4,"   ";:xx=g1%(x,y)+g2%(x,y)+g3%(x,y)
  117. 580 ifxx<10thenprint#4," ";
  118. 585 ifxx<100thenprint#4," ";
  119. 590 print#4,xx"  ";:xx=int(tp%(x,y)/tg%(x,y)):print#4,xx"  ";
  120. 595 iftp%(x,y)<10thenprint#4," ";
  121. 600 iftp%(x,y)<100thenprint#4," ";
  122. 605 iftp%(x,y)<1000thenprint#4," ";
  123. 610 iftp%(x,y)<10000thenprint#4," ";
  124. 615 print#4,tp%(x,y)"    ";:iftg%(x,y)<10thenprint#4," ";
  125. 620 iftg%(x,y)<100thenprint#4," ";
  126. 625 print#4,tg%(x,y)
  127. 630 next:next:return
  128. 635 gosub80:ifx$=""thenreturn
  129. 640 x$="":ln=1:gosub75:input"new name";x$:ifx$=""then635
  130. 645 x$=left$(x$,16):nm$(bn)=x$:goto635
  131. 650 gosub100:ifx$=""thenreturn
  132. 655 x$="":ln=1:gosub75:input"new date";x$:ifx$=""then650
  133. 660 x$=left$(x$,16):dt$(wn)=x$:goto650
  134. 665 x$="":sysa,.,15:print"exit?":wait198,15:getx$:ifx$="y"thensys64738
  135. 670 return
  136. 675 gosub80:ifx$=""thenreturn
  137. 680 print"[147][159]"spc(17)"summary
  138. 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].
  139. 690 g3[178].:g4[178].:g5[178].:x[178]bn
  140. 695 [153]""p$"bowler"p$nm$(bn):[129]y[178]1[164]nw
  141. 700 [139]g1%(x,y)[177]hg[167]hg[178]g1%(x,y)
  142. 705 [139]g2%(x,y)[177]hg[167]hg[178]g2%(x,y)
  143. 710 [139]g3%(x,y)[177]hg[167]hg[178]g3%(x,y)
  144. 715 [139]g1%(x,y)[179]lg[175]g1%(x,y)[177].[167]lg[178]g1%(x,y)
  145. 720 [139]g2%(x,y)[179]lg[175]g2%(x,y)[177].[167]lg[178]g2%(x,y)
  146. 725 [139]g3%(x,y)[179]lg[175]g3%(x,y)[177].[167]lg[178]g3%(x,y)
  147. 730 tg[178]g1%(x,y)[170]g2%(x,y)[170]g3%(x,y)
  148. 735 [139]tg[177]hs[167]hs[178]tg
  149. 740 [139]tg[179]ls[175]tg[177].[167]ls[178]tg
  150. 745 [139]tg[177]849[167]s8[178]s8[170]1:[137]785
  151. 750 [139]tg[177]799[167]s7[178]s7[170]1:[137]785
  152. 755 [139]tg[177]749[167]s6[178]s6[170]1:[137]785
  153. 760 [139]tg[177]699[167]s5[178]s5[170]1:[137]785
  154. 765 [139]tg[177]649[167]s4[178]s4[170]1:[137]785
  155. 770 [139]tg[177]599[167]s3[178]s3[170]1:[137]785
  156. 775 [139]tg[177]549[167]s2[178]s2[170]1:[137]785
  157. 780 [139]tg[177]499[167]s1[178]s1[170]1
  158. 785 [139]g1%(x,y)[177]299[167]g5[178]g5[170]1:[137]810
  159. 790 [139]g1%(x,y)[177]274[167]g4[178]g4[170]1:[137]810
  160. 795 [139]g1%(x,y)[177]249[167]g3[178]g3[170]1:[137]810
  161. 800 [139]g1%(x,y)[177]224[167]g2[178]g2[170]1:[137]810
  162. 805 [139]g1%(x,y)[177]199[167]g1[178]g1[170]1
  163. 810 [139]g2%(x,y)[177]299[167]g5[178]g5[170]1:[137]835
  164. 815 [139]g2%(x,y)[177]274[167]g4[178]g4[170]1:[137]835
  165. 820 [139]g2%(x,y)[177]249[167]g3[178]g3[170]1:[137]835
  166. 825 [139]g2%(x,y)[177]224[167]g2[178]g2[170]1:[137]835
  167. 830 [139]g2%(x,y)[177]199[167]g1[178]g1[170]1
  168. 835 [139]g3%(x,y)[177]299[167]g5[178]g5[170]1:[137]860
  169. 840 [139]g3%(x,y)[177]274[167]g4[178]g4[170]1:[137]860
  170. 845 [139]g3%(x,y)[177]249[167]g3[178]g3[170]1:[137]860
  171. 850 [139]g3%(x,y)[177]224[167]g2[178]g2[170]1:[137]860
  172. 855 [139]g3%(x,y)[177]199[167]g1[178]g1[170]1
  173. 860 [130]:[139]tg%(x,40)[178].[167]xx[178].:[137]870
  174. 865 xx[178][181](tp%(x,40)[173]tg%(x,40))
  175. 870 [153]p$"current avg    "xx
  176. 875 [153]p$"high game      "hg;rt$p$"low game       "lg
  177. 880 [153]p$"high series    "hs;rt$p$"low series     "ls
  178. 885 [153]p$"200 games      "g1;rt$p$"225 games      "g2
  179. 890 [153]p$"250 games      "g3;rt$p$"275 games      "g4
  180. 895 [153]p$"300 games      "g5
  181. 900 [153]p$"500 series     "s1;rt$p$"550 series     "s2
  182. 905 [153]p$"600 series     "s3;rt$p$"650 series     "s4
  183. 910 [153]p$"700 series     "s5;r