start tok64 d64-KVQT6U 1 REM file name = bowling manager 2 POKE53280,0:POKE53281,0:PRINT CHR$(5):PRINT CHR$(147) 3 INPUT"name for bowler 1 ";name$(1):INPUT"name for bowler 2 ";name$(2):d=1 4 bl$="************************ bowling scores 1984-85 ************************" 5 s1$="series":a1$="average":g1$="game 1":g2$="game 2":g3$="game 3" 6 DIM a(2,36),b(2,36),c(2,36),ser(2,36),avg%(2,36),blnk$(36),wk(36) 7 FOR ax=1 TO 10 :PRINT:NEXT 8 PRINT SPC(8)"bowling manager program" 9 FOR ac=1 TO 8:PRINT:NEXT:PRINT SPC(16)"by vincent j.barbaro" 10 FOR ab=1TO12:PRINT:NEXT:INPUT"hit return";tt:PRINTCHR$(147) 11 PRINT"{clear}":PRINTSPC(12)"please choose one":FOR af=1TO5:PRINT:NEXT 12 PRINT SPC(9) "1 = start new file":PRINTSPC(9) "2 = update old file" 13 PRINT SPC(9) "3 = list old file":PRINT SPC(9) "4 = ammend old file" 14 PRINT SPC(9) "5 = exit program":PRINT:PRINT 15 INPUT"choose";l:IFl<1ORl>5THENPRINT"{clear}":GOTO10 16 ON l GOTO 20,100,100,100,80 20 PRINT CHR$(147):OPEN 15,8,15:FOR ad=1 TO 10:PRINT:NEXT 30 INPUT"enter file name";aa$:OPEN 2,8,2,"0:"+aa$+"s,w":PRINTCHR$(147) 40 GOSUB 900 45 REM write data to file 50 FOR g=1 TO (d-1) 52 PRINT#2,g 55 PRINT#2,a(1,g):PRINT#2,a(2,g) 60 PRINT#2,b(1,g):PRINT#2,b(2,g) 65 PRINT#2,c(1,g):PRINT#2,c(2,g):PRINT#2," " 70 NEXT g 75 CLOSE2:CLOSE15:GOTO 10 80 PRINT "{clear}":FOR a=1TO12:PRINT:NEXT:PRINT SPC(7)"e n d{space*2}o f{space*2}p r o g r a m ":END 100 REM file retrive routine 102 IF l=5 THEN 80 110 OPEN 15,8,15 :PRINT CHR$(147) 120 PRINT"enter file name":INPUT"(to display update or ammend)";aa$ 125 PRINT CHR$(147) 130 OPEN 2,8,2,"@0:"+aa$+"s,r" 135 INPUT "enter current week no. ";wk 140 FOR d=1 TO wk 160 INPUT#2,wk(d),a(1,d),a(2,d),b(1,d),b(2,d),c(1,d),c(2,d),blnk$(d) 162 ser(1,d)=a(1,d)+b(1,d)+c(1,d) 164 ser(2,d)=a(2,d)+b(2,d)+c(2,d) 165 avg%(1,d)=ser(1,d)/3 166 avg%(2,d)=ser(2,d)/3 170 PRINT"week ";wk(d),g1$,g2$,g3$,s1$,a1$ 180 PRINT name$(1),a(1,d),b(1,d),c(1,d),ser(1,d),avg%(1,d) 181 PRINT name$(2),a(2,d),b(2,d),c(2,d),ser(2,d),avg%(2,d) 182 PRINT:NEXT 183 GOSUB 1110 184 IF l=2 THEN 190 185 IF l=3 THEN CLOSE 2:CLOSE 15:INPUT"hit return";gg:GOTO 350 186 IF l=4 THEN 480 187 IF l=5 THEN 80 190 REM file update routine 200 CLOSE 2:OPEN 2,8,2,"@0:"+aa$+"s,w": c=d 205 GOSUB 900 210 REM write old data back to file 220 FOR g=1 TO (c-1) 225 PRINT#2,wk(g) 230 PRINT#2,a(1,g):PRINT#2,a(2,g) 240 PRINT#2,b(1,g):PRINT#2,b(2,g) 250 PRINT#2,c(1,g):PRINT#2,c(2,g):PRINT#2," " 260 NEXT g 265 REM write new data to file 270 FOR i=c TO d-1 275 PRINT#2,i 280 PRINT#2,a(1,i):PRINT#2,a(2,i) 290 PRINT#2,b(1,i):PRINT#2,b(2,i) 300 PRINT#2,c(1,i):PRINT#2,c(2,i):PRINT#2," " 310 NEXT i 320 PRINT#2,a(1,g):CLOSE2 330 CLOSE 15 340 GOTO 10 350 REM print out routine 352 PRINT CHR$(147) 355 PRINT"for a print out enter (1=yes or 2=no)" 360 GET yn:IF yn<1ORyn>2 THEN 360 370 ON yn GOTO 380,375 375 PRINT CHR$(147):GOTO 11 380 OPEN 1,4,2 385 PRINT CHR$(147):PRINT " please wait while printing listing" 386 PRINT#1, bl$ 388 PRINT#1,"":PRINT#1,"" 390 FOR e=1 TO (d-1) 395 PRINT#1,"week ";eSPC(5)g1$SPC(5)g2$SPC(5)g3$SPC(8)s1$SPC(9)a1$ 400 PRINT#1,name$(1)SPC(8)a(1,e)SPC(6)b(1,e)SPC(6)c(1,e),ser(1,e),avg%(1,e) 410 PRINT#1,name$(2)SPC(8)a(2,e)SPC(6)b(2,e)SPC(6)c(2,e),ser(2,e),avg%(2,e) 415 PRINT#1,blnk$(e) 420 NEXT e 422 GOSUB 1030 425 FOR f=1TO6:PRINT#1,blnk$(e):NEXT 430 CLOSE1:CLOSE15:PRINT CHR$(147):GOTO 11 440 PRINT "enter week number to ammend":PRINT 445 CLOSE 2:OPEN 2,8,2,"@0:"+aa$+"s,w": c=d 450 GET n:IF n <1ORn>a THEN 450 460 h=n 480 REM file data ammend routine 490 PRINT"week number = ";h:PRINT 500 PRINT"enter store name ( or stop)":PRINT:INPUT name$(h):PRINT 510 IF name$(h)="stop" THEN 10 520 PRINT "enter specialty":PRINT:INPUT spec$(h):PRINT 530 PRINT "enter street address":PRINT:INPUT sreet$(h):PRINT 540 PRINT "enter town state and zip code":PRINT:INPUT state$(h):PRINT 550 PRINT "enter phone number":PRINT:INPUT number$(h) 560 PRINT CHR$(147): INPUT "save record (1=yes 2=no)";yn 570 IF yn<1 OR yn>2 THEN 560 580 ON yn GOTO 590,490 590 PRINTCHR$(147):PRINTSPC(14)"writing to disk{.*3}" 595 IF h=1 THEN 750 600 IF h=(a-1) THEN 690 610 aa=1 615 IF h=aa THEN 650 620 PRINT#2,name$(aa):PRINT#2,SPC(4)spec$(aa):PRINT#2,SPC(4)sreet$(aa) 630 PRINT#2,SPC(4)state$(aa):PRINT#2,SPC(4)number$(aa):PRINT#2,"{space*2}" 640 aa=aa+1:IF aa=a THEN 75 645 GOTO 615 650 PRINT#2,h;") ";name$(h) 660 PRINT#2,spec$(h):PRINT#2,sreet$(h):PRINT#2,state$(h) 670 PRINT#2,number$(h):PRINT#2," " 680 aa=aa+1 :GOTO 620 690 REM write old data back to file 700 FOR b=1 TO (c-2) 710 PRINT#2,name$(b) 720 PRINT#2,spec$(b):PRINT#2,sreet$(b):PRINT#2,state$(b) 730 PRINT#2,number$(b):PRINT#2," " 740 NEXT b 750 REM write new data to file 760 PRINT#2,h;") ";name$(h) 770 PRINT#2,spec$(h):PRINT#2,sreet$(h):PRINT#2,state$(h) 780 PRINT#2,number$(h):PRINT#2," " 790 PRINT#2,name$(a):CLOSE2 800 CLOSE 15 810 GOTO 10 900 REM data input subroutine 910 PRINT"week number = ";d:PRINT 920 PRINT"enter score for ";name$(1);" game 1 (or 0 = stop)":INPUT a(1,d):PRINT 925 IF a(1,d)=0 THEN 1010 930 PRINT "enter score for ";name$(2);" game 1":INPUT a(2,d):PRINT 940 PRINT "enter score for ";name$(1);" game 2":INPUT b(1,d):PRINT 950 PRINT "enter score for ";name$(2);" game 2":INPUT b(2,d):PRINT 960 PRINT "enter score for ";name$(1);" game 3":INPUT c(1,d):PRINT 970 PRINT "enter score for ";name$(2);" game 3":INPUT c(2,d):PRINT 980 PRINT CHR$(147): INPUT "save record (1=yes 2=no)";yn 990 IF yn <1 OR yn>2 THEN 980 1000 ON yn GOTO 1005,900 1005 d=d+1:PRINT"{clear}":GOTO 910 1010 PRINTCHR$(147):PRINTSPC(12)"writing to disk{.*3}" 1020 RETURN 1030 REM total wood + average printer 1040 FOR j=1 TO wk 1050 tw(1)=tw(1)+ser(1,j) 1060 tw(2)=tw(2)+ser(2,j):NEXT 1070 PRINT#1,SPC(9)"total wood"SPC(5)"average" 1075 gw%(1)=tw(1)/(wk*3) 1080 PRINT#1,name$(1)SPC(5)tw(1)SPC(9)gw%(1) 1085 gw%(2)=tw(2)/(wk*3) 1090 PRINT#1,name$(2)SPC(5)tw(2)SPC(9)gw%(2) 1100 tw(1)=0:tw(2)=0:RETURN 1110 REM total wood and average video 1120 FOR j=1 TO wk 1130 tw(1)=tw(1)+ser(1,j) 1140 tw(2)=tw(2)+ser(2,j):NEXT 1150 PRINTSPC(9)"total wood"SPC(5)"average" 1155 gw%(1)=tw(1)/(wk*3) 1160 PRINTname$(1)SPC(5)tw(1)SPC(9)gw%(1) 1165 gw%(2)=tw(2)/(wk*3) 1170 PRINTname$(2)SPC(5)tw(2)SPC(9)gw%(2) 1180 tw(1)=0:tw(2)=0:RETURN stop tok64 (bastext 1.0)