mirror of
https://github.com/rfivet/BCG101.git
synced 2024-12-18 08:06:27 -05:00
375 lines
7.9 KiB
QBasic
375 lines
7.9 KiB
QBasic
10 PRINT "THIS IS A DEMONSTRATION OF PDP-11 BASIC"
|
|
20 PRINT "IF YOU NEED INSTRUCTIONS FOR PLAYING FOOTBALL, TYPE A 1";
|
|
30 INPUT I
|
|
40 IF I<>1 THEN 340
|
|
50 PRINT
|
|
60 PRINT
|
|
70 PRINT "WHEN IT ASKS YOU A QUESTION TO BE ANSWERED YES OR"
|
|
80 PRINT "NO, TYPE IN 0 FOR NO OR 1 FOR YES."
|
|
90 PRINT
|
|
100 PRINT "ON OFFENSE YOU HAVE THE FOLLOWING PERMITTED PLAYS:"
|
|
110 PRINT "PLAY","CODE"
|
|
120 PRINT "RUN","10"
|
|
130 PRINT "PASS","11"
|
|
140 PRINT "SWEEP","12"
|
|
150 PRINT "SCREEN PASS","13"
|
|
160 PRINT "LONG PASS","14"
|
|
170 PRINT "DRAW PLAY","15"
|
|
180 PRINT "PUNT","16"
|
|
190 PRINT "FIELDGOAL","17"
|
|
200 PRINT
|
|
210 PRINT "ON DEFENSE, YOU MAY TRY ONE OF THE FOLLOWING:"
|
|
220 PRINT "DEFENSE","CODE"
|
|
230 PRINT "NORMAL","4","GOOD AGAINST SWEEP AND SCREEN"
|
|
240 PRINT "HOLD","5","GOOD AGAINST RUN, PASS AND DRAW"
|
|
250 PRINT "BLITZ","6","GOOD AGAINST PASS OR LONG PASS"
|
|
260 PRINT "INTERCEPT","7","INCREASES THE ODDS FOR AN INTERCEPTION"
|
|
270 PRINT "BLOCK","8","GIVES YOU A CHANCE TO BLOCK A KICK,"
|
|
280 PRINT " "," ","BUT DECREASES THE DISTANCE RUNBACK."
|
|
290 PRINT
|
|
300 PRINT "TO CALL A PARTICULAR PLAY JUST TYPE ITS CODE NUMBER."
|
|
310 PRINT "ALSO, AT ANY TIME DURING PLAY YOU MAY CALL TIME OUT"
|
|
320 PRINT "BY TYPING A '2'. HOWEVER YOU ARE PERMITTED ONLY THREE"
|
|
330 PRINT "TIMEOUTS PER HALF."
|
|
340 PRINT
|
|
350 PRINT
|
|
360 DEF FNT(X)=SIN(X)/COS(X)
|
|
370 DIM R(17)
|
|
380 FOR I=0 TO 17
|
|
390 READ R(I)
|
|
400 NEXT I
|
|
410 DATA 9,13,100,0,9,10,12,11,12,0,1,5,3,4,6,2,8,7
|
|
420 RANDOMIZE
|
|
430 LET F=0
|
|
440 LET Z3=0
|
|
450 LET O=0
|
|
460 LET L=0
|
|
470 DIM Z(5,3),P(2),D(2,5)
|
|
480 FOR A=0 TO 5
|
|
490 FOR B=0 TO 2
|
|
500 READ Z(A,B),D(B,A)
|
|
505 LET P(B)=0
|
|
510 NEXT B
|
|
520 READ Z(A,3)
|
|
530 NEXT A
|
|
540 PRINT "DO YOU WANT TO RECEIVE";
|
|
550 LET X=1
|
|
560 GOSUB 3610
|
|
570 LET S=2-SGN(13-Q)
|
|
580 LET K=S
|
|
590 LET T1=120
|
|
600 LET U2=3
|
|
610 LET U=3
|
|
620 LET C=900
|
|
630 GOSUB 2250
|
|
640 LET F1=50
|
|
650 LET B=INT(F1+O*20*RND(0)+(1-O)*29*(2-RND(0)^7-RND(0)^(3-Z2)))
|
|
660 LET O=0
|
|
670 LET Z9=8
|
|
680 GOSUB 1490
|
|
690 LET L=0
|
|
700 IF B<=99 THEN 2340
|
|
710 PRINT "A TOUCHBACK"
|
|
720 LET B=20
|
|
730 LET L=0
|
|
740 IF S=2 THEN 770
|
|
750 PRINT "MY ";
|
|
760 GOTO 780
|
|
770 PRINT "YOUR ";
|
|
780 GOSUB 3290
|
|
790 GOSUB 2980
|
|
800 LET D=1
|
|
810 LET F2=.03
|
|
820 LET O=0
|
|
830 IF C<=0 THEN 2770
|
|
840 GOSUB 2530
|
|
850 LET Z2=1
|
|
860 LET Z3=.3
|
|
870 IF C<=F*T1 THEN 2920
|
|
880 IF C<=0 THEN 2770
|
|
890 IF L=0 THEN 910
|
|
900 PRINT "TIME TO GO--";
|
|
910 PRINT INT(C/60);"MIN.";C-60*INT(C/60);"SEC. ";
|
|
920 PRINT "YOUR PLAY";
|
|
930 GOSUB 3610
|
|
940 IF S=1 THEN 980
|
|
950 IF Q>8 THEN 920
|
|
960 LET M=Q
|
|
970 GOTO 1000
|
|
980 LET Y=Q-8
|
|
990 IF ABS(Q-10.5)^2>3 THEN 920
|
|
1000 LET C=INT(C-L*(5+23*RND(X)))
|
|
1010 LET L=1
|
|
1020 IF M=7 THEN 1760
|
|
1030 IF M=8 THEN 1920
|
|
1040 LET Y1=Y-1
|
|
1050 IF RND(X)>Z(M-1,Y1) THEN 1240
|
|
1060 LET A=2
|
|
1070 GOSUB 3020
|
|
1080 IF M<4 THEN 1110
|
|
1090 PRINT "PASS COMPLETE..";
|
|
1100 LET L=SGN(INT(4*RND(0)))
|
|
1110 IF RND(X)<F2 THEN 2510
|
|
1120 IF G>0 THEN 1210
|
|
1130 IF G=0 THEN 1170
|
|
1140 IF G+B<1 THEN 2170
|
|
1150 PRINT "LOSS OF";-G;
|
|
1160 GOTO 1610
|
|
1170 PRINT "NO GAIN"
|
|
1180 LET Z9=2
|
|
1190 GOSUB 1490
|
|
1200 GOTO 1670
|
|
1210 IF B+G>99 THEN 1650
|
|
1220 PRINT "GAIN OF";G;
|
|
1230 GOTO 1610
|
|
1240 IF M>3 THEN 1280
|
|
1250 LET A=1
|
|
1260 GOSUB 3020
|
|
1270 GOTO 1120
|
|
1280 IF RND(X)<.06*(2-SGN(Y-3)) THEN 1360
|
|
1290 IF RND(0)<.05+INT(Y/3.5)/5 THEN 1510
|
|
1300 LET Z9=6
|
|
1310 GOSUB 1490
|
|
1320 PRINT "PASS INCOMPLETE"
|
|
1330 LET L=0
|
|
1340 LET G=0
|
|
1350 GOTO 3120
|
|
1360 PRINT "PASS **INTERCEPTED**";
|
|
1370 LET A=1
|
|
1380 GOSUB 3020
|
|
1390 IF B<40 THEN 1410
|
|
1400 LET G=20*(1+SGN(G))
|
|
1410 LET B=100-B-G
|
|
1420 LET S=3-S
|
|
1430 LET Z9=9
|
|
1440 GOSUB 1490
|
|
1450 IF B<1 THEN 710
|
|
1460 IF B>99 THEN 1650
|
|
1470 PRINT "AT ";
|
|
1480 GOTO 2360
|
|
1490 LET C=C-INT(4+Z9/2*(1+RND(0)))
|
|
1500 RETURN
|
|
1510 LET G=-(5+INT(10*RND(X)))
|
|
1520 PRINT "THE QUATERBACK ";
|
|
1530 IF RND(X)>.5 THEN 1560
|
|
1540 PRINT "IS THROWN FOR A ";
|
|
1550 GOTO 1110
|
|
1560 LET G=-(2*G+8)
|
|
1570 LET M=5
|
|
1580 LET A=1
|
|
1590 PRINT "SCRAMBLES FOR A ";
|
|
1600 GOTO 1110
|
|
1610 LET B=B+G
|
|
1620 PRINT "TO ";
|
|
1630 GOSUB 3300
|
|
1640 IF B<=99 THEN 1670
|
|
1650 GOSUB 1990
|
|
1660 GOTO 630
|
|
1670 IF B1>B THEN 3120
|
|
1680 IF B1<B THEN 1730
|
|
1690 IF RND(0)>.5 THEN 1730
|
|
1700 PRINT "**MEASUREMENT**"
|
|
1710 GOSUB 3520
|
|
1720 IF RND(X)<.5 THEN 3120
|
|
1730 GOSUB 2980
|
|
1740 LET D=0
|
|
1750 GOTO 3120
|
|
1760 IF RND(X)<.06 THEN 1890
|
|
1770 LET B=B+30+INT(15*(1-RND(X)^3))
|
|
1780 LET Z9=2
|
|
1790 GOSUB 1490
|
|
1800 IF B<=99 THEN 1850
|
|
1810 LET P1=3
|
|
1820 GOSUB 2030
|
|
1830 IF P1=0 THEN 710
|
|
1840 GOTO 630
|
|
1850 PRINT "THE KICK IS ";
|
|
1860 LET Z2=0
|
|
1870 LET S=3-S
|
|
1880 GOTO 2340
|
|
1890 PRINT "**BLOCKED** RECOVERED..";
|
|
1900 LET G=-INT(14*RND(X))
|
|
1910 GOTO 1410
|
|
1920 PRINT "THE PUNT IS ";
|
|
1930 IF RND(X)<.06 THEN 1890
|
|
1940 LET F1=B
|
|
1950 LET Z2=1
|
|
1960 LET S=3-S
|
|
1970 LET Z3=.65
|
|
1980 GOTO 650
|
|
1990 PRINT "** TOUCHDOWN**"
|
|
2000 LET P1=1
|
|
2010 LET P(S)=P(S)+6
|
|
2020 LET B=130
|
|
2030 PRINT "THE KICK IS ";
|
|
2040 IF RND(X)<(B/132)^4 THEN 2070
|
|
2050 LET P1=0
|
|
2060 PRINT "NO ";
|
|
2070 PRINT "GOOD"
|
|
2080 LET P(S)=P(S)+P1
|
|
2090 GOSUB 2120
|
|
2100 LET S=3-S
|
|
2110 RETURN
|
|
2120 PRINT "SCORE: ME";P(1);" YOU";P(2)
|
|
2130 LET L=0
|
|
2140 IF X<5 THEN 2160
|
|
2150 IF P(1)<>P(2) THEN 2770
|
|
2160 RETURN
|
|
2170 PRINT "**SAFETY**"
|
|
2180 LET P(3-S)=P(3-S)+2
|
|
2190 LET F1=30
|
|
2200 LET S=3-S
|
|
2210 GOSUB 2120
|
|
2220 GOSUB 3440
|
|
2230 PRINT "FROM THE 20"
|
|
2240 GOTO 650
|
|
2250 GOSUB 3440
|
|
2260 IF S=2 THEN 2330
|
|
2270 PRINT "ON-SIDE";
|
|
2280 GOSUB 3610
|
|
2290 IF Q<>13 THEN 2330
|
|
2300 LET F2=.15
|
|
2310 LET Z2=1
|
|
2320 LET O=1
|
|
2330 RETURN
|
|
2340 LET B=100-B
|
|
2350 PRINT "RECEIVED AT ";
|
|
2360 GOSUB 3300
|
|
2370 IF Z2*RND(X)>Z3 THEN 2490
|
|
2380 IF RND(X)<F2 THEN 2500
|
|
2390 LET G=5+INT(100*RND(0))
|
|
2400 IF RND(0)<.15 THEN 2430
|
|
2410 LET G=INT(24*(1-RND(X)^2))
|
|
2420 IF G=0 THEN 2490
|
|
2430 LET B=8+G
|
|
2440 PRINT " AND RUN BACK...";
|
|
2450 LET L=1
|
|
2460 IF B>99 THEN 1650
|
|
2470 PRINT " TO ";
|
|
2480 GOSUB 3300
|
|
2490 IF RND(0)>F2 THEN 3260
|
|
2500 LET G=0
|
|
2510 PRINT "**FUMBLE**";
|
|
2520 GOTO 1410
|
|
2530 IF S=1 THEN 2560
|
|
2540 LET Y=INT(1+3.5*RND(0))
|
|
2550 RETURN
|
|
2560 LET M=INT(55*RND(0)/10.5)+1
|
|
2570 IF (B1-B)/(5-D)<3 THEN 2590
|
|
2590 LET M=INT(6-4*RND(0)^2)
|
|
2590 IF L*F*60>=C THEN 2670
|
|
2600 IF D<4 THEN 2550
|
|
2610 PRINT "I'LL ";
|
|
2620 IF B<55 THEN 2720
|
|
2630 IF 0<4*RND(0)-B1+B THEN 2750
|
|
2640 PRINT "TRY FOR A FIELD GOAL"
|
|
2650 LET M=7
|
|
2660 RETURN
|
|
2670 IF P(2)*U2<=P(1)*U2 THEN 2600
|
|
2680 PRINT "TIME OUT"
|
|
2690 LET U2=U2-1
|
|
2700 GOSUB 3520
|
|
2710 GOTO 2600
|
|
2720 PRINT "PUNT"
|
|
2730 LET M=8
|
|
2740 RETURN
|
|
2750 PRINT "GO FOR IT"
|
|
2760 RETURN
|
|
2770 IF X<4 THEN 2830
|
|
2780 IF P(1)=P(2) THEN 2830
|
|
2790 PRINT "THE GAME IS OVER"
|
|
2800 PRINT "FINAL ";
|
|
2810 GOSUB 2120
|
|
2820 STOP
|
|
2830 PRINT "END OF PERIOD";X
|
|
2840 GOSUB 2120
|
|
2850 LET F=1-F
|
|
2860 GOSUB 3520
|
|
2870 LET C=900
|
|
2880 LET X=X+1
|
|
2890 IF F<>0 THEN 810
|
|
2900 LET S=3-K
|
|
2910 GOTO 580
|
|
2920 IF T1=0 THEN 2770
|
|
2930 PRINT "2 MINUTE WARNING"
|
|
2940 GOSUB 3520
|
|
2950 LET T1=0
|
|
2960 LET C=120
|
|
2970 GOTO 880
|
|
2980 LET B1=B+10
|
|
2990 IF B1<=100 THEN 3010
|
|
3000 LET B1=100
|
|
3010 RETURN
|
|
3020 LET Q=1.3*(A*RND(0)-1)-.06
|
|
3030 LET A=1
|
|
3040 IF Q>=0 THEN 3070
|
|
3050 LET A=0
|
|
3060 LET Q=-Q
|
|
3070 LET M1=M-1
|
|
3080 LET G=D(A,M1)+FNT(Q)*(D(2,M1)-D(A,M1))/3.5
|
|
3090 LET G=G+INT(RND(0)+.02)*A*100*RND(0)
|
|
3100 LET G=INT(G)
|
|
3110 RETURN
|
|
3120 LET D=D+1
|
|
3130 IF D=5 THEN 3240
|
|
3140 IF D<> 1 THEN 3160
|
|
3150 PRINT "1ST";
|
|
3160 IF D<>2 THEN 3180
|
|
3170 PRINT "2ND";
|
|
3180 IF D<>3 THEN 3200
|
|
3190 PRINT "3RD";
|
|
3200 IF D<4 THEN 3220
|
|
3210 PRINT "4TH";
|
|
3220 PRINT " AND";B1-B;" ";
|
|
3230 GOTO 810
|
|
3240 LET S=3-S
|
|
3250 LET B=100-B
|
|
3260 IF S=2 THEN 770
|
|
3270 PRINT "MY ";
|
|
3280 GOTO 780
|
|
3290 PRINT "BALL ON ";
|
|
3300 IF B=50 THEN 3400
|
|
3310 LET V=50-ABS(B-50)
|
|
3320 LET C=C-INT(7+3*RND(0))
|
|
3330 IF S=1 THEN 3420
|
|
3340 IF B<50 THEN 3370
|
|
3350 PRINT "MY ";
|
|
3360 GOTO 3380
|
|
3370 PRINT "YOUR ";
|
|
3380 PRINT V
|
|
3390 RETURN
|
|
3400 PRINT "THE 50"
|
|
3410 RETURN
|
|
3420 IF B<50 THEN 3350
|
|
3430 GOTO 3370
|
|
3440 IF S=2 THEN 3470
|
|
3450 PRINT "YOU";
|
|
3460 GOTO 3480
|
|
3470 PRINT "I";
|
|
3480 PRINT " KICK OFF."
|
|
3490 LET F2=.06
|
|
3500 LET Z2=0
|
|
3510 RETURN
|
|
3520 LET L=0
|
|
3530 PRINT "TIMEOUT CALLED..."
|
|
3540 PRINT
|
|
3550 RETURN
|
|
3560 IF U=0 THEN 3600
|
|
3570 LET U=U-1
|
|
3580 GOSUB 3520
|
|
3590 GOTO 3610
|
|
3600 PRINT "..WRONG, TRY AGAIN"
|
|
3610 INPUT A
|
|
3620 IF ABS(INT(A))>17 THEN 3600
|
|
3630 LET Q=R(INT(ABS(A)))
|
|
3640 IF Q=0 THEN 3600
|
|
3650 IF Q=100 THEN 3560
|
|
3660 RETURN
|
|
3670 DATA .5,-2,.25,4,.5,13,.55
|
|
3680 DATA .4,-2,.3,7,.65,15,.75
|
|
3690 DATA .4,-2,.3,6,.6,15,.35
|
|
3700 DATA .65,-2,.65,6,.6,17,.9
|
|
3710 DATA .4,2,.7,10,.4,27,.2
|
|
3720 DATA .1,19,.4,35,.2,100,.1
|
|
3730 END
|