-
Notifications
You must be signed in to change notification settings - Fork 0
/
FOOTBAL2.BAS
183 lines (182 loc) · 7.13 KB
/
FOOTBAL2.BAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
1 PRINT CHR$(26):PRINT TAB(32);"FOOTBALL":PRINT
2 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"
3 PRINT:PRINT:PRINT
100 REM
120 DIM A(20),B(20),C(40),H(2),T(2),W(2),X(2),Y(2),Z(2)
130 DIM M$(2),D(2),P$(20)
140 PRINT "PRESENTING N.F.U. FOOTBALL (NO FORTRAN USED)"
145 PRINT:PRINT
150 INPUT "DO YOU WANT INSTRUCTIONS";A$
160 IF LEFT$(A$,1)="N" OR LEFT$(A$,1)="n" THEN 290
165 IF LEFT$(A$,1)<>"Y" AND LEFT$(A$,1)<>"y" THEN 150
170 PRINT CHR$(26):PRINT "This is a football game for two teams. Players must"
180 PRINT "each enter a data statement (1770 for Team 1, 1780 for"
190 PRINT "Team 2) which scrambles the numbers 1 through 20."
195 PRINT "These numbers are then assigned to twenty fiven plays."
200 PRINT "A list of numbers and their plays is provided, with both"
210 PRINT "teams having the same plays.":
PRINT " The more similar the plays the less yardage gained."
220 PRINT "To punt or attempt a field goal, input 77,77 for play numbers."
223 PRINT "Questions will be asked then. On 4th down, you will also be"
225 PRINT "asked whether you want to punt or attempt a field goal. If the"
227 PRINT "answer to both questions is no, it will be assumed you want to"
230 PRINT "try and gain yardage.":PRINT
240 PRINT " Scores are given whenever scores are made. Scores may also be"
250 PRINT "be obtained by entering 99,99 for play numbers.":PRINT
270 PRINT " The game is played until players terminate (Control-C).":PRINT
280 LINE INPUT "Enter 'RETURN' to begin the game.";XX$:PRINT
290 PRINT:PRINT "PLEASE INPUT SCORE LIMIT ON GAME";:INPUT E
300 FOR I=1 TO 40: READ N: IF I>20 THEN 350
330 A(N)=I: GOTO 360
350 B(N)=I-20
360 C(I)=N: NEXT I
370 FOR I=1 TO 20: READ P$(I): NEXT I
380 L=0: T=1
390 PRINT:LINE INPUT "ENTER 'RETURN' WHEN PAPER POSITIONED.";XX$:PRINT
410 LPRINT "TEAM";T;"PLAY CHART"
412 LPRINT "=================":LPRINT
420 LPRINT "NO. PLAY":LPRINT "-------------":LPRINT
430 FOR I=1 TO 20
440 REM
450 LPRINT USING "##";C(I+L);:LPRINT TAB(6);P$(I)
460 NEXT I
465 LPRINT CHR$(12)
630 L=L+20:T=2
640 LPRINT
680 IF L=20 THEN 410
690 D(1)=0: D(2)=3: M$(1)="--->": M$(2)="<---"
700 H(1)=0: H(2)=0: T(1)=2: T(2)=1
710 W(1)=-1: W(2)=1: X(1)=100: X(2)=0
720 Y(1)=1: Y(2)=-1: Z(1)=0: Z(2)=100
725 GOSUB 1910
730 PRINT "TEAM 1 DEFENDS 0 YD GOAL -- TEAM 2 DEFENDS 100 YD GOAL."
740 T=INT(2*RND(1)+1)
760 PRINT: PRINT "THE COIN IS FLIPPED"
765 P=X(T)-Y(T)*40
770 GOSUB 1860: PRINT : PRINT "TEAM";T;"RECEIVES KICK-OFF"
780 K=INT(26*RND(1)+40)
790 P=P-Y(T)*K
794 IF W(T)*P<Z(T)+10 THEN 810
795 PRINT: PRINT "BALL WENT OUT OF ENDZONE --AUTOMATIC TOUCHBACK--"
796 GOTO 870
810 PRINT "BALL WENT";K;"YARDS. NOW ON";P:GOSUB 1900
830 PRINT "TEAM";T;"DO YOU WANT TO RUNBACK";:INPUT A$
840 IF LEFT$(A$,1)="Y" OR LEFT$(A$,1)="y" THEN 1430
845 IF LEFT$(A$,1)<>"N" AND LEFT$(A$,1)<>"n" THEN 830
850 IF W(T)*P<Z(T) THEN 880
870 P=Z(T)-W(T)*20
880 D=1: S=P
885 FOR I=1 TO 72: PRINT "=";: NEXT I
890 PRINT: PRINT "TEAM";T;"DOWN";D;"ON";P
893 IF D<>1 THEN 900
895 IF Y(T)*(P+Y(T)*10)>=X(T) THEN 898
897 C=4: GOTO 900
898 C=8
900 IF C=8 THEN 904
901 PRINT TAB(27);10-(Y(T)*P-Y(T)*S);"YARDS TO 1ST DOWN"
902 GOTO 910
904 PRINT TAB(27);X(T)-Y(T)*P;"YARDS"
910 GOSUB 1900: IF D=4 THEN 1180
920 REM
930 U=INT(3*RND(0)-1): GOTO 940
936 PRINT "ILLEGAL PLAY NUMBER, CHECK AND"
940 PRINT "INPUT OFFENSIVE PLAY, DEFENSIVE PLAY";
950 IF T=2 THEN 970
960 INPUT P1,P2: GOTO 975
970 INPUT P2,P1
975 IF P1=77 THEN 1180
980 IF P1>20 THEN 1800
985 IF P1<1 THEN 1800
990 IF P2>20 THEN 1800
992 IF P2<1 THEN 1800
995 P1=INT(P1): P2=INT(P2)
1000 Y=INT(ABS(A(P1)-B(P2))/19*((X(T)-Y(T)*P+25)*RND(1)-15))
1005 PRINT: IF T=2 THEN 1015
1010 IF A(P1)<11 THEN 1048
1012 GOTO 1020
1015 IF B(P2)<11 THEN 1048
1020 IF U<>0 THEN 1035
1025 PRINT "PASS INCOMPLETE TEAM";T
1030 Y=0: GOTO 1050
1035 G=RND(1): IF G>.025 THEN 1040
1037 IF Y>2 THEN 1045
1040 PRINT "QUARTERBACK SCRAMBLED": GOTO 1050
1045 PRINT "PASS COMPLETED": GOTO 1050
1048 PRINT "THE BALL WAS RUN"
1050 P=P-W(T)*Y
1060 PRINT: PRINT "NET YARDS GAINED ON DOWN";D;"ARE ";Y
1070 G=RND(1): IF G>.025 THEN 1110
1080 PRINT: PRINT "** LOSS OF POSSESSION FROM TEAM";T;"TO TEAM";T(T)
1100 GOSUB 1850: PRINT: T=T(T): GOTO 830
1110 IF Y(T)*P>=X(T) THEN 1320
1120 IF W(T)*P>=Z(T) THEN 1230
1130 IF Y(T)*P-Y(T)*S>=10 THEN 880
1140 D=D+1: IF D<>5 THEN 885
1160 PRINT: PRINT "CONVERSION UNSUCCESSFUL TEAM";T:T=T(T)
1170 GOSUB 1850: GOTO 880
1180 PRINT "DOES TEAM";T;"WANT TO PUNT";: INPUT A$
1185 IF LEFT$(A$,1)="N" OR LEFT$(A$,1)="n" THEN 1200
1187 IF LEFT$(A$,1)<>"Y" AND LEFT$(A$,1)<>"y" THEN 1180
1190 PRINT:PRINT "TEAM";T;"WILL PUNT": G=RND(1): IF G<.025 THEN 1080
1195 GOSUB 1850: K=INT(25*RND(1)+35): T=T(T): GOTO 790
1200 PRINT "DOES TEAM";T;"WANT TO ATTEMPT A FIELD GOAL";: INPUT A$
1210 IF LEFT$(A$,1)="Y" OR LEFT$(A$,1)="y" THEN 1640
1215 IF LEFT$(A$,1)<>"N" AND LEFT$(A$,1)<>"n" THEN 1200
1217 GOTO 920
1230 PRINT: PRINT "SAFETY AGAINST TEAM";T;"**********************OH-OH"
1240 H(T(T))=H(T(T))+2: GOSUB 1810
1280 PRINT"TEAM";T;"DO YOU WANT TO PUNT INSTEAD OF A KICKOFF";:INPUT A$
1290 P=Z(T)-W(T)*20: IF A$="YES" THEN 1190
1320 PRINT: PRINT "TOUCHDOWN BY TEAM";T;"*********************YEA TEAM"
1340 Q=7: G=RND(1): IF G>.1 THEN 1380
1360 Q=6: PRINT "EXTRA POINT NO GOOD": GOTO 1390
1380 PRINT "EXTRA POINT GOOD"
1390 H(T)=H(T)+Q: GOSUB 1810
1420 T=T(T): GOTO 765
1430 K=INT(9*RND(0)+1)
1440 R=INT(((X(T)-Y(T)*P+25)*RND(1)-15)/K)
1460 P=P-W(T)*R
1480 PRINT:PRINT "RUNBACK TEAM";T;R;"YARDS"
1485 G=RND(1): IF G<.025 THEN 1080
1490 IF Y(T)*P>=X(T) THEN 1320
1500 IF W(T)*P>=Z(T) THEN 1230
1510 GOTO 880
1640 PRINT: PRINT "TEAM";T;"WILL ATTEMPT A FIELD GOAL"
1645 G=RND(1): IF G<.025 THEN 1080
1650 F=INT(35*RND(1)+20)
1660 PRINT: PRINT "KICK IS";F;"YARDS LONG"
1680 P=P-W(T)*F: G=RND(1)
1690 IF G<.35 THEN 1735
1700 IF Y(T)*P<X(T) THEN 1740
1710 PRINT "FIELD GOAL GOOD FOR TEAM";T;"*********************YEA"
1720 Q=3: GOTO 1390
1735 PRINT "BALL WENT WIDE"
1740 PRINT "FIELD GOAL UNSUCCESFUL TEAM";T;"-----------------TOO BAD"
1742 GOSUB 1850: IF Y(T)*P<X(T)+10 THEN 1745
1744 T=T(T): GOTO 794
1745 PRINT: PRINT "BALL NOW ON";P
1750 T=T(T): GOSUB 1900: GOTO 830
1770 DATA 17,8,4,14,19,3,10,1,7,11,15,9,5,20,13,18,16,2,12,6
1780 DATA 20,2,17,5,8,18,12,11,1,4,19,14,10,7,9,15,6,13,16,3
1790 DATA "PITCHOUT","TRIPLE REVERSE","DRAW","QB SNEAK","END AROUND"
1792 DATA "DOUBLE REVERSE","LEFT SWEEP","RIGHT SWEEP","OFF TACKLE"
1794 DATA "WISHBONE OPTION","FLARE PASS","SCREEN PASS"
1796 DATA "ROLL OUT OPTION","RIGHT CURL","LEFT CURL","WISHBONE OPTION"
1798 DATA "SIDELINE PASS","HALF-BACK OPTION","RAZZLE-DAZZLE","BOMB!!!!"
1800 IF P1<>99 THEN 936
1810 PRINT: PRINT "TEAM 1 SCORE IS";H(1)
1820 PRINT "TEAM 2 SCORE IS";H(2): PRINT
1825 IF H(T)<E THEN 1830
1827 PRINT "TEAM";T;"WINS*******************": GOTO 2000
1830 IF P1=99 THEN 940
1835 RETURN
1850 PRINT
1860 FOR X=1 TO 72: PRINT "+";: NEXT X: PRINT
1870 RETURN
1900 PRINT TAB(D(T)+5+P/2);M$(T)
1910 PRINT "TEAM 1 [0 10 20 30 40 50 60 70 80 90";
1915 PRINT " 100] TEAM 2"
1920 PRINT
1930 RETURN
2000 RUN "MENU"