Trailing-Edge
-
PDP-10 Archives
-
decus_20tap1_198111
-
decus/20-0020/baseba.gam
There are 2 other files named baseba.gam in the archive. Click here to see a list.
100' NAME--BASEBALL
110'
120' DESCRIPTION--GENERATES A BASEBALL GAME OF THE 1967 WORLD SERIES
130'
140' SOURCE--JACOB BERGMANN '69, AUGUST 1967.
150'
160' INSTRUCTIONS--TYPE "RUN" AND FOLLOW INSTRUCTIONS ANSWERING THE
170' QUESTIONS WITH "YES" OR "NO" UNLESS OTHERWISE INDICATED.
180' NOTE: FOR A FASTER GAME TYPE: 580 GO TO 955
190' 5800 GO TO 985
200'
210'
220' * * * * * * * MAIN PROGRAM * * * * * * * * * *
230'
240RANDOM
250FOR I=0 TO 19
260READ N$(I)
270FORJ=1 TO 8
280 READ S(I,J)
290 NEXT J
300 NEXT I
310 FOR I=1 TO 24
320 FOR J=0 TO 4
330 READ E(I,J)
340 NEXT J
350 NEXT I
360 FOR I=1 TO 30
370 FOR J=0 TO 4
380 READ A(I,J)
390 NEXT J
400 NEXT I
410 FOR I=1 TO 11
420 FOR J=1 TO 6
430READ Q(I,J)
440 NEXT J
450 NEXT I
460 FOR I=1 TO 30
470 FOR J=0 TO 2
480 READ D(I,J)
490 NEXT J
500 NEXT I
510 DIM S(19,8),E(24,4),A(30,4),D(30,2),Q(11,6),N$(19)
520 DATA "RED SOX",.02,.071,.303,.072,0,.004,.993,0
530 DATA "LONBORG",0,.013,.045,.128,0,0,.95,9
540 DATA "HOWARD",.013,.013,.039,.176,0,0,.946,8
550 DATA "SCOTT",.032,.046,.084,.301,1,0,.936,4
560 DATA "ANDREWS",.015,.015,.055,.259,1,0,.966,2
570 DATA "ADAIR",.008,.01,.052,.259,0,0,.975,1
580 DATA "PETROCELLI",.035,.04,.091,.267,0,0,.954,6
590 DATA "YASTRZEMSKI",.072,.08,.13,.309,1,1,.985,3
600 DATA "REGGIE SMITH",.029,.04,.082,.25,2,2,.952,7
610 DATA "HARRELSON",.036,.039,.085,.252,2,0,.917,5
620 DATA "CARDINALS",.024,.057,.274,-.002,0,.004,.996,0
630 DATA "GIBSON",.01,.01,.048,.18,1,0,.958,9
640 DATA "MCCARVER",.029,.035,.086,.295,1,1,.973,5
650 DATA "CEPEDA",.046,.046,.111,.330,1,0,.908,4
660 DATA "JAVIER",.028,.034,.067,.288,1,0,.981,6
670 DATA "SHANNON",.027,.033,.071,.244,0,0,.904,7
680 DATA "MAXVILL",.002,.011,.042,.225,0,0,.967,8
690 DATA "BROCK",.029,.046,.094,.291,3,1,.936,1
700 DATA "FLOOD",.008,.01,.055,.324,0,0,1,2
710 DATA "MARIS",.023,.038,.082,.265,0,1,.989,3
720 DATA .17,.21,.24,.27,.3,.24,.29,.33,.37,.4,.17,.21,.24,.27,.3
730 DATA .67,.71,.75,.78,.81,.73,.79,.84,.89,.94,.67,.71,.75,.78,.81
740 DATA .15,.19,.22,.25,.27,.6,.65,.7,.74,.78,.15,.19,.22,.25,.27
750 DATA .85,1,1,1,1,.95,1,1,1,1,.85,1,1,1,1
760 DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
770 DATA 0,0,0,0,0,0,0,0,0,.1,.1,.17,.23,.29,.35
780 DATA 0,0,0,0,0,.3,.39,.47,.53,.58,.69,.8,.88,.92,.95
790 DATA .4,.49,.57,.65,.72,.81,.9,.96,1,1,1,1,1,1,1
800 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,.05,.1
810 DATA 0,0,0,0,0,0,0,.05,.1,.14,.38,.43,.48,.52,.56,.4,.48,.55,.62
820 DATA .68,.58,.67,.75,.82,.89,1,1,1,1,1,.05,.1,.15,.2,.3,.1,.15,.2
830 DATA .25,.35,.05,.1,.15,.2,.3,.72,.79,.85,.9,.94,1,1,1,1,1,.72,.79
840 DATA .85,.9,.94,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
850 DATA .63,.75,.85,.9,.93,.48,.59,.67,.72,.76,.32,.42,.48,.53,.58
860 DATA .14,.23,.28,.33,.37,.51,.58,.62,.66,.7,.27,.36,.43,.49,.55
870 DATA .1,.17,.24,.31,.37,0,.02,.05,.09,.16,.14,.21,.28,.33,.38
880 DATA .08,.11,.14,.17,.2,.02,.04,.06,.08,.09,0,0,0,0,0
890 DATA 1,1,.9,1,.75,1,1,1,.2,.4,1,1,1,1,1,.8,1,.8,.8,0,.6,.75,.35
900 DATA .75,.65,0,.35,.55,.2,.55,.6,0,.25,.35,.1,.35,.1,0,.05,.05
910 DATA .2,.1,.4,0,.3,.15,.2,.15
920 DATA .7,0,.8,.3,.1,.15,.45,0,.5,.55,.35,.45,.7,0,.1,.15,.7,.35
930 DATA .033,.033,2,.045,.042,3,.054,.054,5,.0564,.0576,7,.06,.06,9
940 DATA .07,.075,5,.1,.11,6,.135,.14,4,.15,.15,3,.158,.158,1,.16,.16
950 DATA 2,.2775,.207,5,.442,.301,6,.536,.4655,4,.583,.583,3,.63,.63,1
960 DATA .64,.632,5,.662,.6352,6,.6652,.6572,4,.6672,.6672,3,.67,.67,1
970 DATA .702,.69,7,.73,.718,8,.75,.75,9,.8102,.778,7,.862,.8298,8
980 DATA .89,.89,9,.9395,.9065,7,.9835,.9505,8,1,1,9
990 LET T=O2=1
1000PRINT"THE WORLD SERIES-- FROM ST. LOUIS, MO."
1010 PRINT"QUESTIONS ASKING 'WHICH BASE' SHOULD BE ANSWERED WITH A DIGIT"
1020PRINT"THOSE ASKING ABOUT ADVANCEMENT OF RUNNERS WILL PRINT"
1030 PRINT"PROBABILITIES IF YOU TYPE 'PR'"
1040 LET T4=W2=9
1050 LET H1=O1=O3=T3=S(10,8)=S(0,8)=I2=W1=W3=0
1060 IF T=0 THEN 1090
1070 PRINT
1080 LET I2=I2+1
1090 LET T=1-T
1100 PRINT
1110 PRINT
1120 PRINT"INNING"I2"FOR "N$(10*T)
1130 LET T5=T4
1140 LET T4=W2
1150 LET W2=T5
1160 LET O=L(1)=L(2)=L(3)=B(1)=B(2)=B(3)=M1=P5=0
1170 LET I1=T3=F1=B(4)=B(5)=B(6)=L(4)=L(5)=L(6)=L(7)=L(8)=L(9)=0
1180 LET T7=W6=0
1190 IF P5=0 THEN 1220
1200 LET P5=0
1210 GOSUB8010
1220 IF M1=0 THEN 1290
1230 LET D=M1
1240 GOSUB 8110
1250 IF O3=1 THEN 1280
1260 PRINT N$(B(0))" ON BASE"M1
1270 LET B(M1)=B(0)
1280 LET M1=0
1290 LET O3=0
1300 IF B(1)+B(2)+B(3)=0 THEN 1350
1310 PRINT"ANY LEADING OR STEALING";
1320 INPUT T$
1330 IF T$="NO" THEN 1350
1340 GOTO 5920
1350 IF W1=0 THEN 1380
1360 LET S(B(0),6)=2
1370 LET W1=0
1380IF W3=T+1 THEN 1410
1390 LET W2=W2+1
1400GOTO 1420
1410LET W3=0
1420 LET W2=W2-9*INT((W2-1)/9)
1430 FOR I=1 TO 9
1440 IF S(10*T+I,8)=W2 THEN 1470
1450 NEXT I
1460 PRINT "ERROR IN BAT POS."
1470 LET B(0)=10*T+I
1480 GOTO 6840
1490 IF S(B(0),6)<2 THEN 1520
1500 LET S(B(0),6)=1-S(10*(1-T),5)
1510 LET W1=1
1520IF RND>S(10*(1-T),1) THEN 1570
1530 PRINT"WILD PITCH"
1540 LET D=1
1550 GOSUB 8110
1560 GOTO 1520
1570 IF RND>S(10*(1-T),6) THEN 1620
1580 PRINT "PASSED BALL"
1590 LET D=1
1600 GOSUB 8110
1610 GO TO 1570
1620IF B(3)=0THEN 1670
1630 PRINT"INFIELD IN";
1640 INPUT T$
1650 IF T$<>"YES" THEN 1670
1660 LET I1=1
1670 IF RND>S(10*(1-T),2) THEN 1810
1680 PRINT N$(B(0))" WALKS"
1690 LET D=1
1700 IF B(1)=0 THEN 1790
1710 IF B(2)=0 THEN 1770
1720 IF B(3)=0 THEN 1750
1730 LET I=3
1740 GOSUB 8310
1750 LET I=2
1760 GOSUB 8310
1770 LET I=1
1780 GOSUB 8310
1790 LET B(1)=B(0)
1800GOTO 1170
1810 LET A=S(10*(1-T),4)
1820 IF A>0 THEN 1840
1830 LET A=2*A
1840 LET A=A+.02-.04*ABS(S(10*(1-T),5)-S(B(0),6))
1850 LET X1=RND
1860 LET X2=RND
1870 IF ABS(ABS(A)+3*A)<4*RND THEN 1900
1880IF A>0 THEN 3410
1890 LET F1=1
1900 LET X=RND
1910 IF X>S(B(0),1) THEN 2130
1920 PRINT N$(B(0))" HITS A HOME RUN";
1930 LET D=4
1940 IF X1>.01 THEN 2000
1950 PRINT", INSIDE THE PARK"
1960 GOSUB 8110
1970 PRINT N$(B(0))" SCORES"
1980 GOSUB8010
1990 GOTO 1170
2000 IF X1>.22 THEN 2060
2010PRINT" TO CENTER FIELD"
2020 LET H1=1
2030 GOSUB 8110
2040 LET H1=0
2050 GOTO 1970
2060 IF X1>.42 THEN 2090
2070 PRINT" TO LEFT FIELD"
2080 GOTO 2020
2090 IF X1>.8 THEN 2110
2100 IF S(B(0),6)=0 THEN 2070
2110 PRINT" TO RIGHT FIELD"
2120 GOTO 2020
2130 IF X>S(B(0),2) THEN 2330
2140 PRINT N$(B(0))" TRIPLES ";
2150 IF X1<.6 THEN 2240
2160 PRINT"TO RIGHT FIELD"
2170 LET D=3
2180 GOSUB 8110
2190 IF X>S(B(0),1)+.0002 THEN 2220
2200 PRINT N$(B(0))" IS OUT TRYING FOR A HOME RUN"
2210 GOTO8160
2220 LET B(3)=B(0)
2230 GOTO 1170
2240 IF X1<.35 THEN 2270
2250 PRINT"TO CENTER FIELD"
2260 GOTO 2170
2270 IF X1>.05 THEN 2300
2280 PRINT"TO LEFT FIELD"
2290 GOTO 2170
2300 IF S(B(0),6)=1 THEN 2160
2310 IF X1>.15 THEN 2250
2320 GOTO 2280
2330 IF X>S(B(0),3) THEN 2620
2340 LET D=2
2350 PRINT N$(B(0))" DOUBLES ";
2360 IF X1>.56 THEN 2390
2370 PRINT"IN THE HOLE TO ";
2380 GOTO 2400
2390 PRINT"OFF THE WALL IN ";
2400ONX2/.35+10/7+4*S(B(0),6)GOTO2410,2410,2440,2470,2470,2470,2440,2410
2410 PRINT"LEFT FIELD"
2420 LET F=1
2430 GOTO 2490
2440 PRINT"CENTER FIELD"
2450 LET F=2
2460 GOTO 2490
2470 PRINT"RIGHT FIELD"
2480 LET F=3
2490 GOSUB 8110
2500 IF X>S(B(0),2)+.0004 THEN 2540
2510 PRINT N$(B(0))" IS OUT TRYING FOR A TRIPLE"
2520 GOSUB 8110
2530 GOTO 8160
2540 LET B(2)=B(0)
2550 IF B(3)=0 THEN 1170
2560 LET C=E(3*INT(X1+.44)+F,S(B(3),5))
2570 LET I=3
2580 PRINT "DO YOU WANT THE DOUBLE TO FURTHER";
2590 GOSUB 8440
2600 IF O1=1 THEN 8160
2610 GOTO 1170
2620 IF X>S(B(0),4) THEN 3390
2630 LET D=1
2640 PRINT N$(B(0))" SINGLES ";
2650 IF X1<.08 THEN 3180
2660 ON X1/.37+41/37 GOTO 2670,2700,2730
2670 PRINT "SHARPLY ";
2680 LET F2=1
2690 GOTO 2750
2700 PRINT "ON THE GROUND ";
2710 LET F2=2
2720 GOTO 2750
2730 PRINT "DEEP ";
2740 LET F2=3
2750ONX2/.35+11/7+4*S(B(0),6)GOTO2760,2760,2790,2820,2820,2820,2790,2760
2760 PRINT"TO LEFT FIELD"
2770 LET F=1
2780 GOTO 2840
2790 PRINT"TO CENTER FIELD"
2800 LET F=2
2810 GOTO 2840
2820 PRINT"TO RIGHT FIELD"
2830 LET F=3
2840 GOSUB 8110
2850 IF X>S(B(0),3)+.001 THEN 2890
2860 PRINT N$(B(0))" IS OUT TRYING FOR A DOUBLE"
2870 GOSUB 8110
2880 GOTO 8160
2890 LET B(1)=B(0)
2900 IF B(3)=0 THEN 3060
2910 LET C=E(3*(1+F2)+F,S(B(3),5))
2920 LET I=3
2930 IF C<1 THEN 2970
2940 GOSUB 8500
2950 IF O1=1 THEN 8160
2960 GOTO 3060
2970 PRINT"DO YOU WANT "N$(B(3))" TO SCORE";
2980 INPUT T$
2990 IF T$="YES" THEN 3030
3000IF T$="NO" THEN 3060
3010 PRINT"CHANCE="C
3020 GOTO 2970
3030 GOSUB 8580
3040 IF O1=1 THEN 8160
3050 GOTO 1170
3060 IF B(2)=0 THEN 1170
3070 LET C=E(3*(4+F2)+F,S(B(2),5))
3080 LET I=2
3090 IF C<1 THEN 3130
3100 GOSUB 8500
3110 IF O1=1 THEN 8160
3120 GOTO 1170
3130 IF C=0 THEN 1170
3140 PRINT "DO YOU WANT THE SINGLE TO FURTHER";
3150 GOSUB 8440
3160 IF O1=1 THEN 8160
3170 GOTO 1170
3180 IF X2>.2 THEN 3200
3190 ON S(B(0),6)+1 GOTO 3250,3370
3200 IF X2>.65 THEN 3220
3210 ON S(B(0),6)+1 GOTO 3330,3350
3220 IF X2>.95 THEN 3240
3230 ON S(B(0),6)+1 GOTO 3350,3330
3240 ON S(B(0),6)+1 GOTO 3370,3250
3250 PRINT"TO THIRD BASE"
3260 IF B(2)=0 THEN 3300
3270 IF B(1)>0 THEN 3300
3280 LET B(1)=B(2)
3290 LET B(2)=0
3300 GOSUB 8110
3310 LET B(1)=B(0)
3320 GOTO 1170
3330 PRINT"TO SHORTSTOP"
3340 GOTO 3300
3350 PRINT"TO SECOND BASE"
3360 GOTO 3300
3370 PRINT"TO FIRST BASE"
3380 GOTO 3300
3390 IF F1=1 THEN 1900
3400 IF X<I1*(S(B(0),4)+.03) THEN 2630
3410 IF RND>S(10*(1-T),3) THEN 3520
3420 PRINT N$(B(0))" STRIKES OUT"
3430 IF B(1)=0 THEN 3450
3440 IF O<2 THEN 8160
3450 IF RND<S(10*(1-T),7) THEN 8160
3460 PRINT"CATCHER DROPS THE BALL--ERROR"
3470LET D=1
3480 GOSUB 8110
3490 LET B(1)=B(0)
3500 PRINT N$(B(0))" ON FIRST"
3510 GOTO 1170
3520 FOR J=1 TO 29
3530IF X1<D(J,S(B(0),6)) THEN 3560
3540 NEXT J
3550 LET J=30
3560 PRINT N$(B(0))" HITS A ";
3570 IF J>5 THEN 3600
3580 PRINT"FOUL FLY TO ";
3590 GOTO 3760
3600 IF J>11 THEN 3630
3610 PRINT"POP FLY TO ";
3620 GOTO 3760
3630 IF J>16 THEN 3660
3640 PRINT "GROUND BALL TO ";
3650 GOTO 3760
3660 IF J>21 THEN 3690
3670 PRINT"LINE DRIVE TO ";
3680 GOTO 3760
3690 IF J>24 THEN 3720
3700 PRINT"SHORT FLY TO ";
3710 GO TO 3760
3720 IF J>27 THEN 3750
3730 PRINT"MEDIUM FLY TO ";
3740 GOTO 3760
3750 PRINT"LONG FLY TO ";
3760 PRINT N$(10*(1-T)+D(J,2))
3770 IF RND <S(10*(1-T)+D(J,2),7) THEN 4060
3780 IF J>5 THEN 3810
3790 PRINT"FLY IS DROPPED-"N$(B(0))" GETS ANOTHER CHANCE"
3800 GOTO 1670
3810 IF J>21 THEN 3900
3820 IF J>11 THEN 3880
3830 IF B(2)=0 THEN 3880
3840 IF B(1)=0 THEN 3880
3850 IF O=2 THEN 3880
3860 PRINT"INFIELD FLY RULE- BALL DROPPED BUT BATTER IS OUT"
3870 GOTO 8160
3880 PRINT"ERROR- "N$(B(0))" IS SAFE"
3890 GOTO 3470
3900 PRINT"MUFFED FLY- "N$(B(0))" IS SAFE ON ";
3910 IF B(1)=0 THEN 3930
3920 IFO<2 THEN 4030
3930 PRINT"SECOND"
3940 LET E=2
3950 IF J>27 THEN 3970
3960 IF O<2 THEN 4010
3970 LET D=2
3980 GOSUB 8110
3990 LET B(E)=B(0)
4000 GOTO 1170
4010 LET D=1
4020 GOTO 3980
4030 PRINT"FIRST"
4040 LET E=1
4050 GOTO 3950
4060 IF J<4 THEN 8160
4070 IF J>11 THEN 4100
4080 IF J>5 THEN 8160
4090 LET J=2*J+14
4100 IF J>16 THEN 5250
4110 FOR I=1 TO 3
4120 IF B(I)=0 THEN 4150
4130 LET B(I+3)=1
4140 NEXT I
4150 IF B(2)*(1-B(5))=0 THEN 4290
4160OND(J,2)GOTO4190,4190,4170,4170,4190,4220
4170 LET T7=1
4180GOTO 4290
4190 LET B(1)=B(2)
4200 LET B(2)=0
4210 GOTO 4290
4220 PRINT"DO YOU WANT "N$(B(2))" TO TRY FOR THIRD ON THE PLAY";
4230 INPUT T$
4240 IF T$="YES" THEN 4280
4250 IF T$="NO" THEN 4190
4260 PRINT"CHANCE=.3 IF HE IS PLAYED"
4270 GOTO 4220
4280 LET B(5)=.7
4290 IF B(3)*(1-B(6))=0 THEN 4560
4300 LET V=D(J,2)+6*I1
4310ONVGOTO4320,4320,4440,4560,4440,4560,4320,4320,4320,4540,4320,4540
4320 IF B(2)=0 THEN 4400
4330IF T7=0 THEN 4370
4340 LETB(1)=B(2)
4350 LET B(2)=0
4360GOTO 4400
4370 PRINT"TWO MEN HAVE ENDED UP ON THIRD. TRY PLAY AGAIN"
4380 LET B(5)=B(6)=0
4390 GOTO 4110
4400 LET B(2)=B(3)
4410 LET B(3)=0
4420 LET T3=1
4430 GOTO 4560
4440 LET B(6)=.25
4450 PRINT"DO YOU WANT "N$(B(3))" TO TRY TO SCORE ON THE PLAY";
4460 INPUT T$
4470 IF T$="YES" THEN 4560
4480 IF T$="NO" THEN 4520
4490 PRINT"CHANCE="1-B(6)"IF HE IS PLAYED"
4500 PRINT"EVEN IF YOU TYPE 'NO', MAN WILL GO HOME IF BALL THROWN TO 2ND"
4510 GOTO 4450
4520 LET B(6)=0
4530 GOTO 4320
4540 LET B(6)=.4
4550 GOTO 4450
4560 IF B(1)+B(2)+B(3)=0 THEN 8160
4570 PRINT"WHAT BASE DO YOU THROW THE BALL TO(4=HOME,5=LIST CHANCES)";
4580 INPUT T1
4590 IF T1=1 THEN 5220
4600 IF T1<5 THEN 4720
4610PRINT"CHANCES FOR OUTS AT EACH BASE"
4620PRINT"1: AUTOMATIC",
4630 FOR I=2 TO 4
4640 PRINT I":";
4650 IF B(I+2)<>1 THEN 4680
4660 PRINT Q(I-1,D(J,2))"FORCEOUT",
4670 GOTO 4690
4680 PRINT B(I+2)"TAG",
4690 NEXT I
4700 PRINT
4710 GOTO 4560
4720 IF B(T1+2)=0 THEN 4560
4730 IF T3=0 THEN 4780
4740 IF T1<>2 THEN 4780
4750 LET B(3)=B(2)
4760 LET B(2)=0
4770 LET T3=0
4780 IF B(T1+2)=1 THEN 4930
4790 IF RND>B(T1+2) THEN 4870
4800 PRINT"RUNNER IS TAGGED OUT"
4810 LET B(T1-1)=0
4820 LET D=1
4830 GOSUB 8110
4840 PRINT N$(B(0))" ON FIRST"
4850 LET B(1)=B(0)
4860 GOTO 8160
4870 PRINT"EVERYONE IS SAFE"
4880 LET D=1
4890 GOSUB 8110
4900 PRINT N$(B(0))" ON FIRST"
4910 LET B(1)=B(0)
4920 GOTO 1170
4930 IFRND>Q(T1-1,D(J,2)) THEN 4870
4940 PRINT N$(B(T1-1))" FORCED OUT"
4950 LET B(T1-1)=0
4960 IF O=2 THEN 8160
4970 IF T1=4 THEN 5060
4980 IF T1=3 THEN 5040
4990 IF D(J,2)<5 THEN 5020
5000 LET T2=4
5010 GOTO 5070
5020 LET T2=6
5030 GOTO 5070
5040 LET T2=5
5050 GOTO 5070
5060 LET T2=2
5070 PRINT N$(10*(1-T)+T2)" MAKES THE PIVOT"
5080 IF RND<S(10*(1-T)+T2,7) THEN 5120
5090 PRINT"HE THROWS THE BALL AWAY"
5100 LET M1=2
5110 GOTO 8160
5120 LET M1=1
5130 IF T1>2 THEN 5150
5140 LET T1=T1+INT((S(B(0),5)-3)/2)
5150 IF RND>Q(T1+4,D(J,2)) THEN 5200
5160 PRINT"AND OVER TO FIRST FOR THE DOUBLE PLAY"
5170 LET O3=1
5180 LET O2=2
5190 GOTO 8160
5200 PRINT"DOUBLE PLAY NOT SUCCESSFUL"
5210 GOTO 8160
5220 LET O3=1
5230 LET M1=1
5240 GOTO 8160
5250 IF J>21 THEN 5580
5260 IF O=2 THEN 8160
5270 IF B(1)+B(2)+B(3)=0 THEN 8160
5280 PRINT"AT WHAT BASE DO YOU WANT TO TRY FOR A D.P.(4=LIST CHANCES)";
5290 INPUT T1
5300 IF T1<4 THEN 5400
5310 FOR I=1 TO 3
5320 PRINT I":";
5330 IF B(I)=0 THEN 5360
5340 PRINT Q(I+8,D(J,2)),
5350 GOTO 5370
5360 PRINT "NO RUNNER",
5370 NEXT I
5380 PRINT
5390 GOTO 5280
5400 IF B(T1)=0 THEN 5280
5410 IF RND>Q(T1+8,D(J,2)) THEN 5560
5420 LET B(T1)=0
5430 IF O=1 THEN 5490
5440 FOR I=1 TO 3
5450 IF I*T1=3 THEN 5480
5460 IF B(I)=0 THEN5480
5470 GOTO 5520
5480 NEXT I
5490 PRINT"DOUBLE PLAY"
5500 LET O2=2
5510 GOTO 8160
5520 IF RND>.3 THEN 5490
5530 PRINT"TRIPLE PLAY MADE ON "N$(B(I))
5540 LET O2=3
5550 GOTO 8160
5560 PRINT"UNSUCCESSFUL"
5570 GOTO 8160
5580IF O=2 THEN 8160
5590 LET F=J-INT((J-1)/3)*3
5600 IF B(3)=0 THEN 5810
5610 LET C=A(J-12,S(B(3),5))
5620 IF C<1 THEN 5660
5630 LET I=3
5640 GOSUB 8500
5650GOTO 5810
5660 PRINT"DO YOU WANT "N$(B(3))" TO SCORE ON THE FLY";
5670 INPUT T$
5680 IF T$="YES" THEN 5720
5690 IF T$="NO" THEN 8160
5700 PRINT"CHANCE TO SCORE="C
5710 GOTO 5660
5720 IF B(1)=0 THEN 5750
5730 GOSUB 8580
5740 GOTO 5770
5750 LET I=3
5760 GOSUB 8500
5770 IF O1=0 THEN 5800
5780 LET O2=2
5790 LET O1=0
5800 IF O+O2=3 THEN 8160
5810 IF B(2)=0 THEN 8160
5820 LET I=2
5830 LET C=A(J-21,S(B(2),5))
5840 IF C=0 THEN 8160
5850 IF C<1 THEN 5880
5860 GOSUB 8500
5870 GOTO 8160
5880 PRINT"DO YOU WANT THE FLY TO";
5890 GOSUB 8440
5900 LET O2=O2+O1
5910 GOTO 8160
5920 PRINT"WHAT BASE DO YOU WANT TO LEAD FROM(0=NONE)";
5930 INPUT T5
5940 IF T5=0 THEN 6120
5950 IF B(T5)=0 THEN 5920
5960 IF ABS(L(T5)-10*B(T5)-2.5)>2 THEN 6000
5970 PRINT N$(B(T5))"'S PREVIOUS LEAD REMAINS IN EFFECT,"
5980 PRINT"AS LONG AS HE IS ON THAT BASE"
5990 GOTO 5920
6000 LET L(T5)=INT(4*RND)+1
6010 PRINT"RUNNER HAS A TYPE"L(T5)"LEAD (1=BEST,4=WORST)"
6020 LET L(T5)=L(T5)+10*B(T5)
6030 IF RND>.06 THEN 6110
6040 IF RND>S(11-10*T,7) THEN 6080
6050 PRINT N$(B(T5))" PICKED OFF"
6060 LET B(T5)=0
6070 GOTO 8160
6080 PRINT"PITCHER THROWS THE BALL AWAY TRYING FOR A PICKOFF"
6090 LET D=1
6100 GOSUB 8110
6110 IF B(1)*(B(2)+B(3))+B(2)*B(3)>0 THEN 5920
6120 PRINT"WHAT BASE DO YOU WANT TO STEAL FROM(0=NONE,4=LIST CHANCES)";
6130 INPUT T5
6140 IF T5=0 THEN 6420
6150 IF T5<>4 THEN 6280
6160 FOR I=1 TO 3
6170 PRINT I":";
6180 IF B(I)>0 THEN 6210
6190 PRINT"NO RUNNER",
6200 GOTO 6250
6210 IF INT(L(I)/10)=B(I) THEN 6240
6220 PRINT"NO LEAD",
6230 GOTO 6250
6240 PRINT A(4*I+L(I)-10*B(I)+14,S(B(I),5)),
6250 NEXT I
6260 PRINT
6270 GOTO 6120
6280 IF B(T5)>0 THEN 6310
6290 PRINT"NO RUNNER"
6300 GOTO 6120
6310 IF INT(L(T5)/10)=B(T5) THEN 6340
6320 PRINT"RUNNER MAY NOT STEAL WITHOUT TAKING A LEAD FIRST"
6330 GOTO 5920
6340 IF B(T5+1)=0 THEN 6390
6350 IF T5=3 THEN 6390
6360 IF L(T5+4)=1 THEN 6390
6370 PRINT"YOU MUST GIVE THE RUNNER AHEAD OF YOU THE STEAL SIGN FIRST"
6380 GOTO 6120
6390 LET L(T5+3)=1
6400 PRINT"WHAT OTHER BASE DO YOU WANT TO STEAL FROM ON THE PLAY(0=NONE)";
6410 GOTO 6130
6420 IF L(4)+L(5)+L(6)=0 THEN 1350
6430 FOR I=1 TO 3
6440 IF L(I+3)=0 THEN 6470
6450 LET L(I+6)=A(4*I+L(I)-10*B(I)+14,S(B(I),5))
6460 LET T6=I+1
6470 NEXT I
6480IF L(4)+L(5)+L(6)=1 THEN6520
6490 PRINT"WHICH BASE DO YOU THROW TO (4=HOME)";
6500 INPUT T6
6510 IF L(T6+2)=0 THEN 6490
6520 LET I=T6-1
6530IF RND<S(12-10*T,7)THEN 6670
6540 PRINT "ERROR BY THE CATCHER"
6550IF RND<.5 THEN 6570
6560LET W6=1
6570LETD=1
6580FORI=3TO1STEP-1
6590IFL(I+3)=0THEN6610
6600GOSUB8310
6610NEXT I
6620IF W6<>1 THEN6640
6630GOSUB8110
6640IFO1=0THEN 1350
6650LETO2=O1
6660GOTO8160
6670 IFRND<L(I+6) THEN 6720
6680LETO1=O1+1
6690 PRINTN$(B(I))" OUT STEALING"
6700LET B(I)=0
6710 IF O=2 THEN 6570
6720 FOR J=3 TO 1 STEP -1
6730IFJ=I THEN 6770
6740IF L(J+3)<>1 THEN6770
6750IF ABS(J-I)>1 THEN 6770
6760IFL(J)-10*B(J)=4 THEN 6790
6770 NEXT J
6780GOTO 6570
6790 IF RND<L(J+6)THEN 6570
6800 LET O1=O1+1
6810 PRINTN$(B(J))" OUT STEALING"
6820LETB(J)=0
6830GOTO 6570
6840 PRINT
6850 PRINT N$(B(0))" IS UP"
6860PRINT"INTENTIONAL WALK";
6870INPUT T$
6880 IF T$="YES"THEN 1680
6890 PRINT"BUNT";
6900 INPUT T$
6910 IF T$<>"YES" THEN 1490
6920LETP2=0
6930 IF L(4)+L(5)+L(6)=0 THEN 6960
6940 PRINT"BATTER STARTS WITH ONE STRIKE BECAUSE OF STEAL PLAY"
6950 LET P2=1
6960 LET P3=.81+(4-S(B(0),5))^2*.00875
6970 IF B(3)=0 THEN 7040
6980 PRINT"DO YOU WANT A SUICIDE SQUEEZE";
6990 INPUT T$
7000 IF T$<>"YES" THEN 7040
7010 LET P4=1
7020 LET I=3
7030 GOTO 7050
7040 LET P4=0
7050 LET P0=RND
7060GOTO7220
7070 LET O=O+1
7080 LETO1=0
7090 IF O=1 THEN 7120
7100 PRINT"TWO OUTS"
7110GOTO 7130
7120 PRINT"ONE OUT"
7130 PRINT"IS THE BUNT STILL ON";
7140 INPUT T$
7150 IF T$<>"NO" THEN 6970
7160 IF P2<2 THEN 1490
7170 IF RND>S(10*(1-T),3) THEN 1490
7180 PRINT N$(B(0))" STRIKES OUT ON THE NEXT PITCH"
7190 GOTO 8160
7200 LET W3=T+1
7210 GOTO 8160
7220IFP0>.15THEN7370
7230 LET P2=P2+1
7240 PRINT"CALLED STRIKE"P2
7250 LET C=.45-(4-S(B(3),5))^2*.02
7260 IF P2<3 THEN 7320
7270 IF O=2 THEN 8160
7280 IF P4=0 THEN 8160
7290 GOSUB 8500
7300 LET O2=1+O1
7310 GOTO 8160
7320 IF P4=0 THEN 7130
7330 GOSUB 8500
7340 IF O+O1=3 THEN 7200
7350 IF O1=1 THEN 7070
7360 GOTO 7130
7370IFP0>.23THEN7440
7380 PRINT"BUNT IS POPPED UP AND CAUGHT"
7390 IF P4=0 THEN 8160
7400 PRINT N$(B(3))" IS CAUGHT OFF BASE AND IS OUT"
7410 LET B(3)=0
7420 LET O2=2
7430 GOTO 8160
7440IFP0>.49THEN7490
7450 LET P2=P2+1
7460 PRINT"FOUL BUNT, STRIKE"P2
7470 IF P2<3 THEN 7130
7480 GOTO 8160
7490IFP0>.56THEN 7570
7500 PRINT"BAD BUNT, RIGHT BACK AT A FIELDER"
7510 LET J=15
7520 IF P4=0 THEN 4110
7530 LET P5=1
7540 PRINT"NO PLAY AT HOME"
7550 LET B(3)=0
7560 GOTO 4110
7570IFP0>P3THEN7960
7580PRINT"GOOD SACRIFICE BUNT"
7590 IF B(3)>0 THEN 7630
7600 LET D=1
7610GOSUB 8110
7620 GOTO 8160
7630 IF P4=1 THEN 7860
7640 IF B(1)*B(2)=0 THEN 7820
7650 LET B(3)=0
7660 LET D=1
7670 GOSUB 8110
7680 PRINT"DO YOU TRY FOR A FORCEOUT AT HOME?"
7690 PRINT"CHANCE=.75. IF YOU TYPE 'NO', BATTER IS OUT";
7700 INPUT T$
7710 IF T$<>"NO" THEN7740
7720 LET P5=1
7730 GOTO 8160
7740 PRINT N$(B(0))" ON FIRST"
7750 LET B(1)=B(0)
7760 IF RND<.75 THEN 7800
7770 PRINT"SAFE AT HOME"
7780 GOSUB 8010
7790 GOTO 1170
7800 PRINT"OUT AT THE PLATE"
7810 GOTO 8160
7820 PRINT"DO YOU TRY TO KEEP THE RUN FROM SCORING(IF YOU DO,"
7830 PRINT"BATTER IS SAFE)";
7840 INPUT T$
7850IF T$="YES" THEN 7890
7860 LET M1=1
7870 LET O3=1
7880 GOTO 8160
7890 IF B(2)>0 THEN 7930
7900 LET I=1
7910 LET D=1
7920 GOSUB 8310
7930 PRINT N$(B(0))" ON FIRST"
7940 LET B(1)=B(0)
7950 GOTO 1170
7960 PRINT"BUNT SINGLE--"N$(B(0))" ON FIRST"
7970 LET D=1
7980 GOSUB 8110
7990 LET B(1)=B(0)
8000 GOTO 1170
8010 LETS(10*T,8)=S(10*T,8)+1
8020 PRINT"SCORE:",N$(0);S(0,8),N$(10);S(10,8)
8030 IF I2<9 THEN 8100
8040 IF T=0 THEN 8100
8050 IF S(0,8)>=S(10,8) THEN 8100
8060 IF H1=1 THEN 8100
8070 PRINT"GAME IS OVER***"
8080 PRINT"FINAL SCORE:",N$(0);S(0,8),N$(10);S(10,8)
8090 STOP
8100 RETURN
8110 FOR I=3 TO 1 STEP -1
8120 IF B(I)=0 THEN 8140
8130 GOSUB 8310
8140 NEXT I
8150 RETURN
8160 LET O1=0
8170 LET O=O+O2
8180 LET O2=1
8190 IF O>2 THEN 8250
8200 IF O=2 THEN 8230
8210 PRINT"ONE OUT"
8220 GOTO 1170
8230 PRINT "TWO OUTS"
8240 GOTO 1170
8250 IF I2<9 THEN 1060
8260 IF T=1 THEN 8290
8270 IF S(10,8)>S(0,8) THEN8070
8280 GOTO 1060
8290 IF S(10,8)=S(0,8) THEN 1060
8300 GOTO 8070
8310 IF B(I)=0 THEN 8430
8320 PRINT N$(B(I));
8330 IF I+D<4 THEN 8370
8340 PRINT" SCORES"
8350 GOSUB 8010
8360 GOTO 8420
8370 LET B(I+D)=B(I)
8380 IF I+D=2 THEN 8410
8390 PRINT" MOVES TO THIRD"
8400 GOTO 8420
8410 PRINT" MOVES TO SECOND"
8420 LET B(I)=0
8430 RETURN
8440 PRINT" ADVANCE "N$(B(I));
8450 INPUT T$
8460 IF T$="YES" THEN 8500
8470 IF T$="NO" THEN 8540
8480 PRINT"CHANCE OF ADVANCING="C
8490 GOTO 8440
8500 IF RND<C THEN 8550
8510 LETO1=1
8520 PRINT N$(B(I))" IS OUT"
8530 LET B(I)=0
8540 RETURN
8550 LET D=1
8560 GOSUB 8310
8570 RETURN
8580 IF B(2)>0 THEN 8780
8590 LET D=1
8600PRINT"DO YOU WANT "N$(16+F-10*T)" TO THROW TO THE PLATE";
8610INPUT T$
8620 IF T$="YES" THEN 8660
8630 IF T$="NO" THEN 8930
8640 PRINT"CHANCE TO SCORE="C
8650 GOTO 8600
8660 PRINT"DO YOU WANT "N$(B(1))" TO BREAK FOR SECOND";
8670INPUT T$
8680 IF T$="YES" THEN 8730
8690 IF T$="NO" THEN 8780
8700 PRINT".3 CHANCE TO BE OUT AND .15 CHANCE TO BE FORCED BACK TO FIRST,"
8710 PRINT"UNLESS BALL GOES THROUGH TO PLATE"
8720 GOTO 8660
8730 PRINT"DO YOU WANT THE THROW CUT OFF";
8740 INPUT T$
8750 IF T$="YES" THEN 8810
8760 LET I=1
8770 GOSUB 8310
8780 LET I=3
8790 GOSUB 8500
8800 RETURN
8810 LET I=3
8820 GOSUB 8310
8830 ON RND/.55+16/11 GOTO 8840,8880,8910
8840 PRINT"OUT AT SECOND"
8850 LET O1=1
8860 LET B(1)=0
8870 RETURN
8880 LET I=1
8890 GOSUB 8310
8900 RETURN
8910 PRINT N$(B(1))" BLUFFS AND GOES BACK TO FIRST"
8920 RETURN
8930 LET I=3
8940 GOSUB 8310
8950 RETURN
8960 END