mirror of
https://github.com/rfivet/BCG101.git
synced 2024-11-18 02:17:00 -05:00
139 lines
5.6 KiB
QBasic
139 lines
5.6 KiB
QBasic
|
100 DIMB(6),C(0),F(0),Z(0)
|
||
|
110 LETZ(0)=.5\LETZ=.5
|
||
|
120 LETI=1
|
||
|
130 LETB1=0\LETB2=0\LETB3=0\LETI1=0\LETI2=0\LETI3=0
|
||
|
140 LETC1=0\LETC2=0\PRINT
|
||
|
150 IFC2<>4THEN160\PRINT"THE BATTER WALKS."\GOSUB920\GOTO140
|
||
|
160 IFC1<>3THEN180\PRINT"THE BATTER STRUCK OUT."\LET C3=C3+1\GOTO140
|
||
|
170 IF S1=1THEN180\LETX=X+1
|
||
|
180 IFC3<3THEN270\IFS1=1THEN190\LETS1=1\GOTO200
|
||
|
190 PRINT"AFTER";I;"INNINGS";\LETI=I+1\LETS1=0
|
||
|
200 PRINTI2;"RUNS,";I1;"HITS,";I3;"ERRORS AND";B1+B2+B3;"LEFT ON BASE."
|
||
|
210 IFI=5THEN1420\IFS1=0THEN230\PRINT"I'M";\GOTO240
|
||
|
220 IFS1=0THEN230\PRINT"I'M";\GOTO240
|
||
|
230 PRINT"YOU'RE";
|
||
|
240 PRINT" UP NOW."\PRINT"SCORE: ME";S2;"YOU";S3
|
||
|
250 PRINT\LETC3=0
|
||
|
260 GOTO130
|
||
|
270 PRINT"YOUR PLAY";
|
||
|
280 LINPUT B$\ CHANGE B$ TO B
|
||
|
290 LETD=1*RND(5)\PRINT
|
||
|
300 LETC=100*B(1)+B(2)+12928\IF S1=0THEN420
|
||
|
310 IFC<>19713THEN320\LETD=D+C(X)\GOTO1280 ' CURVE
|
||
|
320 IFC<>19993THEN330\LETD=D+F(X)\GOTO1280 ' FAST
|
||
|
330 IFC=19597THEN1280 ' BEAN
|
||
|
340 IFC=19610THEN1280 ' BRUSH
|
||
|
350 IFC=21304THEN1280 ' SLIDE
|
||
|
360 IFC=20506THEN1280 ' KNUCKLE
|
||
|
370 IFC<>20110THEN380\IFD<.8THEN1280\GOTO1270 ' GREASE
|
||
|
380 IFC<>21308THEN390\IFD<.8THEN1280\GOTO1270 ' SPIT
|
||
|
390 IFC<>19700THEN400\PRINT"RUNNERS ARE STICKING."\GOTO270 ' CHECK
|
||
|
400 IFC<>19593THEN410\PRINT"MY BATTER";\GOSUB570\GOTO140 ' BALL
|
||
|
410 FORA1=1TOB(0)\PRINTCHR$(B(A1));\NEXTA1\PRINT"?"\GOTO270
|
||
|
420 IFC<>19613THEN430\PRINT"YOUR BATTER";\GOSUB570\GOTO140 ' BUNT
|
||
|
430 IFC=21315THEN1280 ' SWING
|
||
|
440 IFC<>19700THEN450\PRINT"CHECK NOT YET IN."\GOTO270 ' CHECK
|
||
|
450 IFC=20201THEN1280 ' HIT
|
||
|
460 IFC<>21312THEN470\PRINT"STEAL NOT YET IN."\GOTO270 ' STEAL
|
||
|
470 IFC=21293THEN1280 ' SACRIFICE
|
||
|
480 IFC=20110THEN1280 ' GROUND
|
||
|
490 IFC=20004THEN1280 ' FLY
|
||
|
500 IFC=20501THEN1280 ' KILL
|
||
|
510 GOTO410
|
||
|
520 LETA=9*RND(6)\IFS1=0THEN530\PRINT"MY BATTER";\GOTO540
|
||
|
530 PRINT"YOUR BATTER";
|
||
|
540 IFA>1THEN550\PRINT" LINED OUT TO THE THIRD BASEMAN."\GOTO840
|
||
|
550 IFA>2THEN560\PRINT" POPPED OUT IN SHALLOW LEFT."\GOTO840
|
||
|
560 IFA>3THEN580
|
||
|
570 PRINT" GROUNDED TO THE PITCHER";\GOTO590
|
||
|
580 IFA>4THEN680\PRINT" GROUNDED TO SHORTSTOP";
|
||
|
590 PRINT" WHO THREW OUT THE MAN";\IFC3=2THEN670
|
||
|
600 IFB1=0THEN670\IFB2=0THEN630\IFB3=0THEN620\PRINT" FORCED HOME."
|
||
|
610 GOTO850
|
||
|
620 PRINT" FORCED TO THIRD."\GOTO850
|
||
|
630 LETA1=INT(3*RND(0))\PRINT" FORCED TO SECOND";\IFA1<>1THEN650
|
||
|
640 PRINT"."\GOTO850
|
||
|
650 PRINT\PRINT"AND THEN TO FIRST FOR A DOUBLE PLAY!"
|
||
|
660 LETC3=C3+1\LETB1=0\GOTO840
|
||
|
670 PRINT" AT FIRST."\GOTO840
|
||
|
680 IFA>5THEN700\PRINT" HIT A FLY INTO DEEP CENTER WHERE IT WAS";
|
||
|
690 PRINT" CAUGHT."\GOTO710
|
||
|
700 IFA>6THEN880\PRINT" HIT TO LEFT FIELD FOR AN OUT."
|
||
|
710 IFC3=2THEN840\IFB1+B2+B3=0THEN840
|
||
|
720 PRINT"THE MAN ON";\IFB3=1THEN730\IFB2=1THEN750\GOTO790
|
||
|
730 PRINT" THIRD MADE IT HOME,";\GOSUB930\LETB3=0
|
||
|
740 IFB2=0THEN780
|
||
|
750 PRINT" SECOND";\IFA1=0THEN760\PRINT" STAYED PUT."\GOTO780
|
||
|
760 IFA1>1THEN770\PRINT" MADE IT TO THIRD."\LETB3=1\LETB2=0\GOTO780
|
||
|
770 PRINT" WAS OUT TRYING TO TAKE THIRD."\LETC3=C3+1\LETB2=2
|
||
|
780 IFB1<>1THEN840
|
||
|
790 IFB2<>1THEN800\PRINT" FIRST STUCK."\GOTO840
|
||
|
800 PRINT" ON FIRST";\IFB2<>2THEN820
|
||
|
810 PRINT" MADE IT TO SECOND."\LETB2=1\LETB1=0\GOTO840
|
||
|
820 LETW=2*RND(0)\IFW>1THEN810\PRINT" WAS OUT GOING."\LETC3=C3+1
|
||
|
830 LETB2=0
|
||
|
840 LETZ(Y)=Z(Y)-(Z(Y)/100)\GOTO860
|
||
|
850 LETZ(Y)=Z(Y)+(Z(Y)/100)
|
||
|
860 LETC3=C3+1\PRINT"THAT WAS OUT NUMBER";C3
|
||
|
870 GOTO1260
|
||
|
880 IFA>7THEN890\PRINT" HIT OVER THE PITCHER'S HEAD FOR A";\GOTO910
|
||
|
890 IFA>8THEN900\PRINT" HIT THROUGH THE HOLE INTO RIGHT FOR A";\GOTO910
|
||
|
900 PRINT" HIT INTO LEFT FIELD FOR A";
|
||
|
910 IFZ>4*DTHEN1210\IFZ>3*DTHEN1130\IFZ>2*DTHEN1040\PRINT" SINGLE."
|
||
|
920 IFB3=0THEN970\GOSUB930\LETB3=0\GOTO960
|
||
|
930 IFS1=1THEN940\LETS3=S3+1\GOTO950
|
||
|
940 LETS2=S2+1
|
||
|
950 LETI2=I2+1\RETURN
|
||
|
960 PRINT"THE MAN ON THIRD SCORED."
|
||
|
970 IFB2=0THEN1000\PRINT"THE MAN ON SECOND";\IFA>8THEN990\PRINT" SCORED."
|
||
|
980 GOSUB930\LETB2=0\GOTO1000
|
||
|
990 PRINT" WENT TO THIRD."\LETB2=0\LETB3=1
|
||
|
1000 IFB1=0THEN1030\PRINT"THE MAN ON FIRST";\IFA>8THEN1020
|
||
|
1010 IFC2=4THEN1020\LETB1=0\GOTO990
|
||
|
1020 PRINT" TO SECOND."\LETB2=1
|
||
|
1030 LETB1=1\GOTO1240
|
||
|
1040 LETW=3*RND(0)\IFW>1THEN1050\PRINT"N OFF THE WALL";
|
||
|
1050 IFA2=1THEN1060\PRINT" STAND UP";
|
||
|
1060 PRINT" DOUBLE."\IFB3=0THEN1080\PRINT"THE MAN ON THIRD SCORED."
|
||
|
1070 GOSUB930\LETB3=0
|
||
|
1080 IFB2=0THEN1090\PRINT"THE MAN ON SECOND SCORED."\GOSUB930\LETB2=0
|
||
|
1090 IFB1=0THEN1120\PRINT"THE MAN ON FIRST";\IFA>8THEN1110\PRINT" SCORED."
|
||
|
1100 GOSUB930\LETB1=0\GOTO1120
|
||
|
1110 PRINT" WENT TO THIRD."\LET B1=0\LETB3=1
|
||
|
1120 LETB2=1\GOTO1240
|
||
|
1130 PRINT" TRIPLE!"\LETA3=B1+B2+B3\IFA3=0THEN1200\PRINT"THE MAN ON";
|
||
|
1140 IFB1=0THEN1150\PRINT" FIRST";\GOSUB930
|
||
|
1150 IFB2=0THEN1170\IFB1=0THEN1160\PRINT", AND";
|
||
|
1160 PRINT" SECOND";\GOSUB930
|
||
|
1170 IFB3=0THEN1190\IFB1+B2=0THEN1180\PRINT", AND";
|
||
|
1180 PRINT" THIRD";\GOSUB930
|
||
|
1190 PRINT" SCORED."\LETB1=0\LETB2=0
|
||
|
1200 LETB3=1\GOTO1240
|
||
|
1210 IFB1+B2+B3<3THEN1220\PRINT" GRAND SLAM";
|
||
|
1220 PRINT" HOME RUN!!"\FORA1=1TO(B1+B2+B3+1)\GOSUB930\NEXTA1
|
||
|
1230 LETB1=0\LETB2=0\LETB3=0
|
||
|
1240 IFC2=4THEN1260\LETZ(Y)=Z(Y)+(Z(Y)/100)
|
||
|
1250 LETI1=I1+1
|
||
|
1260 RETURN
|
||
|
1270 PRINT"PITCHER THROWN OUT FOR THROWING ILLEGAL PITCH."\GOTO270
|
||
|
1280 LETA=5*RND(0)\IFA<3THEN1320
|
||
|
1290 IFA>4THEN1300\PRINT"INSIDE - ";\GOTO1310
|
||
|
1300 PRINT"OUTSIDE - ";
|
||
|
1310 LETC2=C2+1\PRINT"BALL";C2\GOTO150
|
||
|
1320 IFZ(Y)<DTHEN1340\GOSUB520\IFA<6THEN1330\LETC(Y)=C(Y)+1\GOTO140
|
||
|
1330 LETC(Y)=C(Y)-1\GOTO140
|
||
|
1340 LETC(Y)=C(Y)-1\LETB=3*RND(7)
|
||
|
1350 IFB>1THEN1360\PRINT"A SWING & A MISS - ";\GOTO1390
|
||
|
1360 IFB>2THEN1380\PRINT"INSIDE CORNER - CALL ";
|
||
|
1370 GOTO1390
|
||
|
1380 PRINT"FOUL! - ";\IFC1=2THEN1400
|
||
|
1390 LETC1=C1+1\PRINT" STRIKE";C1\GOTO150
|
||
|
1400 PRINT"COUNT STAYS AT";C2;"BALLS AND";C1;
|
||
|
1410 PRINT"STRIKES."\GOTO150
|
||
|
1420 PRINT"FINAL SCORE: ME";S2;"YOU";S3
|
||
|
1430 IFS2>S3THEN1450\IFS3=S2THEN1440\PRINT"YOU WON."\GOTO1460
|
||
|
1440 PRINT"A DRAW!"\GOTO1460
|
||
|
1450 PRINT"I WON!"
|
||
|
1460 CHAIN"DEMON "
|
||
|
1470 END
|