Info

Listing conllmu'd from p. 57

1610 REM " Convert buffer variables to A( ) •*

1620 GET 1,R»A(2)-CVI(QBS)«A( 3)-CVI (FMS):A(4)-CVI (PAS)«A(5)-CVS(FPS)

1630 A(6)-CVI(FT$)IA(7)"CVI(F2S):A(8)-CVS(F3S)iA(9)-CVI(PS)

1640 A(10)-CVI(SA$)sA(ll)-CVI(00$):A(12)-CVI(DRS)iA(13)-CVI(TR5)

1650 A(14)-CVI(RAS)iA(15)-CVI(TNS)iA(16)-CVI(AAS)IA(17)-CVI(DFS)

1660 A(18)-CVI(STS):A(19)-CVI(BSS)IA(20)-CVI(FOS)«RETURN

1670 REM •* Subroutine to print stats from PGM to Fouls **

1680 GOSUB 1220 «LPRINT USING T$; A(3)|iG0SUB 1290 sLPRINT USING T$> A(4)I

1690 GOSUB 1230 :LPRINT USING T$; A(5);:G0SUB 1220

1700 FOR Y- 6 TO 7:LPRINT USING TS; A(Y);:NEXT V:GOSUB 1230

1710 LPRINT USING T$; A(8)jiG0SUB 1290 ■ LPRINT USING TS; A(9);«GOSUB 1240

1720 LPRINT USING T$; A(10);«GOSUB 1220

1730 FOR Y- 11 TO 13 «LPRINT USING T$; A(Y)|iNEXT Y:GOSUB 1240 1740 LPRINT USING TS; A(14);«GOSUB 1220

1750 FOR Y-15 TO 20«LPRINT USING TS; A(Y);iNEXT YjLPRINT* '«RETURN 1760 REM ** Convert T(x,y) to A(y) " 1770 FOR Y-l TO 20:A(Y)-T(X,Y)iNEXT YIRETURN 1780 REM •• Main Menu ••

1790 CLSiPRlNTTAB(21)"Basketball Statistics" 1800 PRINT TAB(30)"Menu"

1810 PRINT TAB(6)"A) Initialize information for a new team' 1820 PRINT TAB(6)*B) Add a player to the roster*

1831 PRINT TAB(6)*C) Make corrections to previously entered information' 1840 PRINT TAB(6)*D) Type in statistics for a game' 1850 PRINT TAB(6)'B) Print the team record*

1860 PRINT TAB(6)"F) Print team totals (game by game - with opponents) 1870 PRINT TAB(6)*G) Print team totals (with up-to-date totals for players)* 1880 PRINT TAB(6)"H) Print statistics for an individual player" 1890 PRINT TAB(6)'I) Print statistics for a particular game' 1900 PRINT TAB(6)*J) Exit the program*

1910 PRINTiPRINT TAB(4)"Enter your choice (A - J) from abovei*; 1920 TS-""«T-0

1930 POKE 16409,liTS-INKEYStlF LEN(T$)-0 THEN 1930 1940 T-INSTR(*ABCDEFGHIJ*,TS)»IF T-0 THEN 1930 1950 POKE 16409,0

1960 ON T GOSUB 4590,44 80,3390,1990,2510,26 00,2730,2910,3120,120 1970 GOTO 1790

1990 CLS«PRINT TAB(23)"Update Statistics*«GOSUB 270<PRINT TAB(13) S$;* ";Y$

2000 PRINT TAB(28)'Game 4";G+1«PRINT TAB(3) STRINGS(58,140)iPOKE 16916,4

2010 PRINT«PRINT'This section allows you to type in the statistics for'

2020 PRINT'a game. All files will be updated. Are you certain that"

2030 PRINT"you wish to type in game statistics?"«GOSUB 210

2060 PRINT8258, CHR$(31)* Please type in the following information«* 2070 PRINT0389, 'Name of opponent"; « INPUT OS

2080 IF LEN(OS)>14 THEN PRINT'Name can not exceed 14 letters."»GOSUB 160« GOTO 2060

2090 PRINTG517, CHRS(31);"Date of game (MM/DD/YY)";«INPUT D$ 2100 IF LEN(DS)<>8 THEN 2090

2110 PRINT0645, 'Home or Away";»INPUT HSiGOSUB 200 »IF T$-"N" THEN 2060

2120 CLS»PRINT8258, 'Now enter the statistics for each player on"

2130 PRINT'your roster. You will be asked if you wish to update*

2140 PRINT'each player. If you answer 'yes', then you will type*

2150 PRINT'in the numbers for each of the 13 categories. *

2160 PRINT'Remember that you nay just press <ENTER> to put*

2170 PRINT'in a zero for any category."

2180 PRINT:PRINT" When you have completed entering the statistics" 2190 PRINT'for a player, you will be asked if these are correct." 2200 PRlNT'If you have made an error, you will need to re-enter all* 2210 PRINT'the statistics for that player.*«GOSUB 160 «GOSUB 490 2220 REM •* Players Input •• 223 0 FOR X-l TO PiGOSUB 510

2240 PRINT8258, CHR$(31); *Do you wish to update *; PS(X);* (Y/N)?"«GOSUB 210 2250 IF T$-"N" THEN 2300 2260 T(X,1)-T(X,1)+1«A(1)-1

2270 PRINTC258,CHR$(31);P$(X);«PRINT8280,"# *;N$(X);«PRINTi289,"Games«*T(X,1) 2280 PRINT8385,"Quarters";«INPUT A(2)«GOSUB 530 «GOSUB 200 2290 IF TS-"N" THEN 2270

2300 GOSUB 660 »GOSUB 750 »GOSUB 770 »GOSUB 800 «GOSUB 880 «NEXT X 2310 REM •* Team Totals ••

2320 GOSUB 900«GOSUB 1000iX-21«GOSUB 750»GOSUB 770«GOSUB 800«GOSUB 880 2330 REM »• Opponent's totals 2340 X-22«GOSUB 510

2350 PRINT9258,CHR$(31);P$(X)«A(1)-1:A(2)-4 2360 GOSUB 530 «GOSUB 200 «IF T$-"N" THEN 2350

2370 IF A(4)>0 THEN A(5)-A(3)/A(4)«100 2380 IF A(7)>0 THEN A(8)-A(6)/A(7)»100

2390 A(9)-2*A(3)+A(6)iST-A(9)IA(10)-A(9)tA(13)-A(11)+A(12)iA(14)-A(13)

2430 IF G>0 THEN T(X,10)-T(X,9)/T(X,1)«T(X,14)-T(X,13)/T(X,1)

2440 GOSUB 750 «GOSUB 770 «GOSUB 800 «GOSUB 880

2480 GOSUB 250 «GOSUB 310 «GOSUB 1020

2490 POKE 16916,0«RETURN

2510 GOSUB 270«IF G-0 THEN CLStPRINT'No games have been played.•«GOSUB 160« RETURN

2520 GOSUB 1320 «GOSUB 1050 «GOSUB 1080 «LPRINT TAB(60) " Score'

2530 LPRINT TAB(32) 'Game Date Opponent Us Opponent*

2540 LPRINT TAB(32) *----------------------------------------"

2570 FOR X-l TO GI INPUT*3,0$,D$,H$,SU,ST«LPRINT TAB(32) USING TS;X,D$,0$,SU, ST 2580 NEXT X«CLOSE«RETURN

2590 REM »* Print team totals - with opponents • • 2600 GOSUB 270

2610 IP G-0 THEN CLStPRINT'No games have been played*«GOSUB 160 «RETURN 2620 GOSUB 1320 «GOSUB 1050 «GOSUB 1080 «LPRINT* *«GOSUB 1130 «GOSUB 1270 2630 LPRINT TS»«GOSUB 1160 >T$ - RIGHTS(TS,78)«LPRINT TSiGOSUB 1280 2640 LPRINT TSjX-21«GOSUB 750 «GOSUB 770 2650 OPEN*I*,3,'GAMES/TXT*

2660 FOR R-l TO G«INPUT!3,0$,D$,H$,SU,ST«GOSUB 1210 «LPRINT USING TS>R;

2670 GOSUB 1250 «LPRINT USING T$;D$mGOSUB 1260 «LPRINT USING T$;OSf

2680 LPRINT USING * t %"; H$;«GOSUB 1620 :GOSUB 1680 «NEXT RsCLOSE

2690 GOSUB 360 «X-21«GOSUB 1770 «LPRINT* '«LPRINT STRINGS(112,*-*)«LPRINT * *

2700 LPRINT TAB(12)'Totals*! STRINGS(13,32);«GOSUB 1680 «LPRINT * *

2720 REM •• Print team totals - with players "

2730 GOSUB 270 «GOSUB 360 «GOSUB 440 «GOSUB 1320 tGOSUB 1050 «GOSUB 1080

2740 LPRINT TAB(47) USING*«* Game Totals*;GiLPRINT" "■LPRINT* *

2750 GOSUB 1130 «GOSUB 1160 «LPRINT * » Player*, TAB(26) TSiGOSUB 1170

2760 LPRINT TS; «GOSUB 1180 iLPRINT TS

2770 FOR X-l TO PiGOSUB 1770 «GOSUB 2820 «NEXT X

2780 FOR X - 21 TO 22«LPRINT STRINGS(112,*-")iLPRINT* '«GOSUB 1770 2790 GOSUB 2820 iIF G-0 THEN 2810 2800 GOSUB 2860 «GOSUB 2820

2810 LPRINT" "I NEXT XlLPRINT STRING$(112,"-")«RETURN

2820 GOSUB 1190 «LPRINT USING T$; N$(X)|lGOSUB 1200 «LPRINT USING T$; P$(X); 2830 LPRINT* *;iGOSUB 1210 «LPRINT USING T$> A(l)»«GOSUB 1220

2840 LPRINT USING T$; A(2),tGOSUB 1680 iIF X/3-INT(X/3) AND X<20 THEN LPRINT' * 2850 RETURN

2860 A(1)-1iA(2)-4tFOR Y-3 TO 4|A(Y)-A(Y)/G«NEXT Y 2870 FOR Y-6 TO 7tA(Y)-A(Y)/G«NEXT YiA(9)-A(9)/G

2880 FOR Y-ll TO 13iA(Y)-A(Y)/GsNEXT YiPOR Y-15 TO 20|A(Y)-A(Y)/G t NEXT Y 2890 IF X-21 THEN P$(X)-"Team - per game" ELSE PS(X)-*Opp. - per game"«RETURN 2900 REM •• Print statistics for an individual player *•

2910 GOSUB 270 tGOSUB 440 «CLSiTS -"Print Statistics for an Individual Player*

2920 PRINT TAB(11) TS«T$-S$+" *+YS«T-INT((63-LEN(TS))/2)

2930 PRINTtPRINT TAB(T) TSsPRINTiPRINT TAB(28)"Roster"«PRINT

2950 IF X-P THEN PRINT ELSE PRINT TAB(32) X+l; PS(X+1>

2960 NEXT XI PRINT«PRINT"Type the number of the player you want«",

2970 LINE INPUT TSiTl-VAL(TS)

2980 IF T1<0 OR T1>P THEN PRINT"That is not a choice."«GOSUB 160 «RETURN 2990 X-TliGOSUB 750 «GOSUB 1320 tGOSUB 1050 iGOSUB 1080 tTS-'Player: *+PS(X) 3000 GOSUB 1110 iLPRINT TAB(T) TS«TS-"Jersey **+N$(X)«GOSUB 1110 3010 LPRINT TAB(T) TSsLPRINT* *|LPRINT* "iGOSUB 1130 «GOSUB 1160 3020 LPRINT'G* Date Opponent*; TAB(28) RIGHTS(T$,82)iGOSUB 1180

3030 TS-*---------"+STRINGS (15 , *-") + RIGHTS (T$,84) i LPRINT TS

3040 OPEN*I *,3,"GAMES/TXT* tGOSUB 770

3050 FOR R-l TO GiGOSUB 1620 tINPUT*3,0$,D$,H$,SU,STtGOSUB 1210 3060 LPRINT USING T$;R;iGOSUB 1250 «LPRINT USING T$;D$;

3070 LPRINT USING " t «"; OS;«GOSUB 1220 «LPRINT USING T$;A(2);

3080 GOSUB 1680 «NEXT RiLPRINT STRINCS(112,"-")«CLOSE«GOSUB 360

3090 X-TliGOSUB 1770 «LPRINT TAB(12) "Totals";«LPRINT TAB(28) USING "*»»";A(2);

3100 GOSUB 1680 «LPRINT STRINGS(112,*-*)«RETURN

3110 REM •• Print statistics for a particular game

3120 GOSUB 270 iGOSUB 440

3130 IP G-0 THEN CLSiPRINT"There are no games played."iGOSUB 160 iGOTO 470 3140 CLSiPRINT TAB(12) "Print Statistics for a Particular Game" 3150 PRINT TAB(29) "Gamesi"iPRINT 3160 OPEN"I",3,"GAMES/TXT"

3170 FOR Yl-1 TO GIINPUT43,0$,D$, H$, SU,ST:PRINT Y1,0$," - '»HS, 3180 IF Y1O20 THEN 3200 3190 FOR Xl-1 TO 1E3(NEXT XI 3200 NEXT Y11CLOSE I PRINT

3210 PRINTiPRINT"Choose the number of the game you would like to see:"; 3220 LINE INPUT T$:T1-VAL(TS)

3230 IF T1<0 OR T1>G THEN PRINT"That is not one of the choiceB."iGOSUB 160:RETURN

3240 R-Tl«GOSUB 1320 «GOSUB 1050 «OPEN"I",3,"GAMES/TXT"

3250 FOR X-l TO RlINPUTI3,0$,D$,H$,SU,STiNEXT X«CLOSE«GOSUB 1300

3260 LPRINT TAB(34) "Game I",«LPRINT USING T$,R,0$,H$tLPRINT" "iLPRINT" "

3270 GOSUB 1130 tGOSUB 1160 ILPRINT" I Player") TAB(28) RIGHTS(T$,82)

3280 GOSUB 1180 tT$ - "— " + STRINGS(24,"-") + RIGHTS(TS,84)tLPRINT TS

3290 POR X - 1 TO PtLPRINT USING"»»", NS(X),

3300 LPRINT USING " t »", PS(X),tGOSUB 750 «GOSUB 770

3310 GOSUB 1620 «CLOSEiGOSUB 1220 «LPRINT USING TS,A(2),«GOSUB 1680

3320 IF X/3 - INT(X/3) AND X < 20 THEN LPRINT" "

3330 NEXT XtLPRINT" "ILPRINT STRINGS(112,"-")

3340 FOR X-21 TO 22tLPRINT USING "»»", N$(X),

3350 LPRINT USING " » »", PS(X),«GOSUB 750 tGOSUB 770

3360 GOSUB 1620 tCLOSEtGOSUB 1220 ILPRINT USING T$,A(2);tGOSUB 1680 3370 LPRINT STRINGS(112,"-")iNEXT XtRETURN 3380 REN Making corrections ***

3390 CLSiPRINT TAB(22)"Making Corrections"«PRINT TAB(21) STRINGS(21,131) 3400 PRINT« PRINT" Which of the following do you need to change?" 3410 PRINT STRING$(50,140)

3420 PRINT" 1) Name of school, name of coach, or year (19xx - xx)"

3430 PRINT" 2) Number of wins or losses"

3440 PRINT" 3) Name of player or his jersey number"

3450 PRINT" 4) Name of an opponent (the school name)"

3460 PRINT* 5) Date of a game, location of a game (H/A), or score of game" 3470 PRINT* 6) Statistics for a player* 3480 PRINT* 7) Statistics for an opponent* 3490 PRINT* 8) No changes*

3500 PRINT«PRINT'Please enter your choice (1 to 8):*, 3510 T$—INKEYSlT-VAL(TS)tIF T<1 OR T> 8 THEN 3510

3520 ON T GOSUB 3540 , 3620 , 3680 , 3850 , 3850 , 4090 , 4370 iRETURN 3530 REN ••••• Change school, coach, or year "••»

3540 CLSiGOSUB 270 iPRINTiPRINT'School Name is ' SStGOSUB 1400 tPRINT

3550 IF TS-"Y" THEN LINE INPUT'Type in the correct name: ',S$

3560 PRINTtPRINT'Coach's name is 'CStGOSUB 1400 :PRINT

3570 IP T$-"Y" THEN LINE INPUT'Type in the correct name: ",CS

3580 PRINTt PRINT IPRINT"The year is "YStGOSUB 1400 :PRINT

3590 IF TS-"Y" THEN LINE INPUT'Type in the correct year (19xx - xx)t ",Y$ 3600 GOSUB 250 iRETURN

3610 REM **••• Change number of wins or losses *****

3620 CLSiGOSUB 270 1PRINT:PRINT'Number of wins is ",W;G0SUB 1400 :PRINT 3630 IF T$-"Y" THEN LINE INPUT'Enter correct number of wins: *,T$:W-VAL(TS) 3640 PRINT i PRINT'Number of losses is *L:G0SUB 1400 :PRINT

3650 IF T$-*Y* THEN LINE INPUT'Enter correct number of losses: *,T$:L-VAL(T$) 3660 GOSUB 250 :RETURN

3670 REM ***•• Change player or jersey number **•«*

3680 GOSUB 3690 :GOTO 3780

3690 GOSUB 270 iGOSUB 440 tCLS

3700 PRINT'Here is a list of players (with jersey numbers)t"iPRINT 3710 FOR X-l TO P STEP 2iPRINT X,P$(X)i" (I*,N$(X),*)*,

3720 IF X-P THEN PRINT ELSE PRINT TAB(32) X+l, P$(X+1)>* («",NS(X+l),")"

3730 NEXT XiPRINTiPRINT'Which of the above needs to be changed?*

3740 PRINT'Type a number from 0 to*P*(0 means no change)*,

3760 IF T<0 OR T>P THEN 3750

+1 0

Post a comment