1
0
mirror of https://github.com/rfivet/BCG101.git synced 2024-12-29 21:46:32 -05:00
BCG101/port/FOOTBL.BAS
2024-06-16 09:16:48 +08:00

374 lines
7.9 KiB
QBasic

1 PRINT "THIS IS A DEMONSTRATION OF PDP-11 BASIC"
2 PRINT "IF YOU NEED INSTRUCTIONS FOR PLAYING FOOTBALL, TYPE A 1";
3 INPUT I
4 IF I<>1 THEN 34
5 PRINT
6 PRINT
7 PRINT "WHEN IT ASKS YOU A QUESTION TO BE ANSWERED YES OR"
8 PRINT "NO, TYPE IN 0 FOR NO OR 1 FOR YES."
9 PRINT
10 PRINT "ON OFFENSE YOU HAVE THE FOLLOWING PERMITTED PLAYS:"
11 PRINT "PLAY","CODE"
12 PRINT "RUN","10"
13 PRINT "PASS","11"
14 PRINT "SWEEP","12"
15 PRINT "SCREEN PASS","13"
16 PRINT "LONG PASS","14"
17 PRINT "DRAW PLAY","15"
18 PRINT "PUNT","16"
19 PRINT "FIELDGOAL","17"
20 PRINT
21 PRINT "ON DEFENSE, YOU MAY TRY ONE OF THE FOLLOWING:"
22 PRINT "DEFENSE","CODE"
23 PRINT "NORMAL","4","GOOD AGAINST SWEEP AND SCREEN"
24 PRINT "HOLD","5","GOOD AGAINST RUN, PASS AND DRAW"
25 PRINT "BLITZ","6","GOOD AGAINST PASS OR LONG PASS"
26 PRINT "INTERCEPT","7","INCREASES THE ODDS FOR AN INTERCEPTION"
27 PRINT "BLOCK","8","GIVES YOU A CHANCE TO BLOCK A KICK,"
28 PRINT " "," ","BUT DECREASES THE DISTANCE RUNBACK."
29 PRINT
30 PRINT "TO CALL A PARTICULAR PLAY JUST TYPE ITS CODE NUMBER."
31 PRINT "ALSO, AT ANY TIME DURING PLAY YOU MAY CALL TIME OUT"
32 PRINT "BY TYPING A '2'. HOWEVER YOU ARE PERMITTED ONLY THREE"
33 PRINT "TIMEOUTS PER HALF."
34 PRINT
35 PRINT
36 DEF FNT(X)=SIN(X)/COS(X)
37 DIM R(17)
38 FOR I=0 TO 17
39 READ R(I)
40 NEXT I
41 DATA 9,13,100,0,9,10,12,11,12,0,1,5,3,4,6,2,8,7
42 RANDOMIZE
43 LET F=0
44 LET Z3=0
45 LET O=0
46 LET L=0
47 DIM Z(5,3),P(2),D(2,5)
48 FOR A=0 TO 5
49 FOR B=0 TO 2
50 READ Z(A,B),D(B,A)\LET P(B)=0
51 NEXT B
52 READ Z(A,3)
53 NEXT A
54 PRINT "DO YOU WANT TO RECEIVE";
55 LET X=1
56 GOSUB 361
57 LET S=2-SGN(13-Q)
58 LET K=S
59 LET T1=120
60 LET U2=3
61 LET U=3
62 LET C=900
63 GOSUB 225
64 LET F1=50
65 LET B=INT(F1+O*20*RND(0)+(1-O)*29*(2-RND(0)^7-RND(0)^(3-Z2)))
66 LET O=0
67 LET Z9=8
68 GOSUB 149
69 LET L=0
70 IF B<=99 THEN 234
71 PRINT "A TOUCHBACK"
72 LET B=20
73 LET L=0
74 IF S=2 THEN 77
75 PRINT "MY ";
76 GOTO 78
77 PRINT "YOUR ";
78 GOSUB 329
79 GOSUB 298
80 LET D=1
81 LET F2=.03
82 LET O=0
83 IF C<=0 THEN 277
84 GOSUB 253
85 LET Z2=1
86 LET Z3=.3
87 IF C<=F*T1 THEN 292
88 IF C<=0 THEN 277
89 IF L=0 THEN 91
90 PRINT "TIME TO GO--";
91 PRINT INT(C/60);"MIN.";C-60*INT(C/60);"SEC. ";
92 PRINT "YOUR PLAY";
93 GOSUB 361
94 IF S=1 THEN 98
95 IF Q>8 THEN 92
96 LET M=Q
97 GOTO 100
98 LET Y=Q-8
99 IF ABS(Q-10.5)^2>3 THEN 92
100 LET C=INT(C-L*(5+23*RND(X)))
101 LET L=1
102 IF M=7 THEN 176
103 IF M=8 THEN 192
104 LET Y1=Y-1
105 IF RND(X)>Z(M-1,Y1) THEN 124
106 LET A=2
107 GOSUB 302
108 IF M<4 THEN 111
109 PRINT "PASS COMPLETE..";
110 LET L=SGN(INT(4*RND(0)))
111 IF RND(X)<F2 THEN 251
112 IF G>0 THEN 121
113 IF G=0 THEN 117
114 IF G+B<1 THEN 217
115 PRINT "LOSS OF";-G;
116 GOTO 161
117 PRINT "NO GAIN"
118 LET Z9=2
119 GOSUB 149
120 GOTO 167
121 IF B+G>99 THEN 165
122 PRINT "GAIN OF";G;
123 GOTO 161
124 IF M>3 THEN 128
125 LET A=1
126 GOSUB 302
127 GOTO 112
128 IF RND(X)<.06*(2-SGN(Y-3)) THEN 136
129 IF RND(0)<.05+INT(Y/3.5)/5 THEN 151
130 LET Z9=6
131 GOSUB 149
132 PRINT "PASS INCOMPLETE"
133 LET L=0
134 LET G=0
135 GOTO 312
136 PRINT "PASS **INTERCEPTED**";
137 LET A=1
138 GOSUB 302
139 IF B<40 THEN 141
140 LET G=20*(1+SGN(G))
141 LET B=100-B-G
142 LET S=3-S
143 LET Z9=9
144 GOSUB 149
145 IF B<1 THEN 71
146 IF B>99 THEN 165
147 PRINT "AT ";
148 GOTO 236
149 LET C=C-INT(4+Z9/2*(1+RND(0)))
150 RETURN
151 LET G=-(5+INT(10*RND(X)))
152 PRINT "THE QUATERBACK ";
153 IF RND(X)>.5 THEN 156
154 PRINT "IS THROWN FOR A ";
155 GOTO 111
156 LET G=-(2*G+8)
157 LET M=5
158 LET A=1
159 PRINT "SCRAMBLES FOR A ";
160 GOTO 111
161 LET B=B+G
162 PRINT "TO ";
163 GOSUB 330
164 IF B<=99 THEN 167
165 GOSUB 199
166 GOTO 63
167 IF B1>B THEN 312
168 IF B1<B THEN 173
169 IF RND(0)>.5 THEN 173
170 PRINT "**MEASUREMENT**"
171 GOSUB 352
172 IF RND(X)<.5 THEN 312
173 GOSUB 298
174 LET D=0
175 GOTO 312
176 IF RND(X)<.06 THEN 189
177 LET B=B+30+INT(15*(1-RND(X)^3))
178 LET Z9=2
179 GOSUB 149
180 IF B<=99 THEN 185
181 LET P1=3
182 GOSUB 203
183 IF P1=0 THEN 71
184 GOTO 63
185 PRINT "THE KICK IS ";
186 LET Z2=0
187 LET S=3-S
188 GOTO 234
189 PRINT "**BLOCKED** RECOVERED..";
190 LET G=-INT(14*RND(X))
191 GOTO 141
192 PRINT "THE PUNT IS ";
193 IF RND(X)<.06 THEN 189
194 LET F1=B
195 LET Z2=1
196 LET S=3-S
197 LET Z3=.65
198 GOTO 65
199 PRINT "** TOUCHDOWN**"
200 LET P1=1
201 LET P(S)=P(S)+6
202 LET B=130
203 PRINT "THE KICK IS ";
204 IF RND(X)<(B/132)^4 THEN 207
205 LET P1=0
206 PRINT "NO ";
207 PRINT "GOOD"
208 LET P(S)=P(S)+P1
209 GOSUB 212
210 LET S=3-S
211 RETURN
212 PRINT "SCORE: ME";P(1);" YOU";P(2)
213 LET L=0
214 IF X<5 THEN 216
215 IF P(1)<>P(2) THEN 277
216 RETURN
217 PRINT "**SAFETY**"
218 LET P(3-S)=P(3-S)+2
219 LET F1=30
220 LET S=3-S
221 GOSUB 212
222 GOSUB 344
223 PRINT "FROM THE 20"
224 GOTO 65
225 GOSUB 344
226 IF S=2 THEN 233
227 PRINT "ON-SIDE";
228 GOSUB 361
229 IF Q<>13 THEN 233
230 LET F2=.15
231 LET Z2=1
232 LET O=1
233 RETURN
234 LET B=100-B
235 PRINT "RECEIVED AT ";
236 GOSUB 330
237 IF Z2*RND(X)>Z3 THEN 249
238 IF RND(X)<F2 THEN 250
239 LET G=5+INT(100*RND(0))
240 IF RND(0)<.15 THEN 243
241 LET G=INT(24*(1-RND(X)^2))
242 IF G=0 THEN 249
243 LET B=8+G
244 PRINT " AND RUN BACK...";
245 LET L=1
246 IF B>99 THEN 165
247 PRINT " TO ";
248 GOSUB 330
249 IF RND(0)>F2 THEN 326
250 LET G=0
251 PRINT "**FUMBLE**";
252 GOTO 141
253 IF S=1 THEN 256
254 LET Y=INT(1+3.5*RND(0))
255 RETURN
256 LET M=INT(55*RND(0)/10.5)+1
257 IF (B1-B)/(5-D)<3 THEN 259
258 LET M=INT(6-4*RND(0)^2)
259 IF L*F*60>=C THEN 267
260 IF D<4 THEN 255
261 PRINT "I'LL ";
262 IF B<55 THEN 272
263 IF 0<4*RND(0)-B1+B THEN 275
264 PRINT "TRY FOR A FIELD GOAL"
265 LET M=7
266 RETURN
267 IF P(2)*U2<=P(1)*U2 THEN 260
268 PRINT "TIME OUT"
269 LET U2=U2-1
270 GOSUB 352
271 GOTO 260
272 PRINT "PUNT"
273 LET M=8
274 RETURN
275 PRINT "GO FOR IT"
276 RETURN
277 IF X<4 THEN 283
278 IF P(1)=P(2) THEN 283
279 PRINT "THE GAME IS OVER"
280 PRINT "FINAL ";
281 GOSUB 212
282 STOP
283 PRINT "END OF PERIOD";X
284 GOSUB 212
285 LET F=1-F
286 GOSUB 352
287 LET C=900
288 LET X=X+1
289 IF F<>0 THEN 81
290 LET S=3-K
291 GOTO 58
292 IF T1=0 THEN 277
293 PRINT "2 MINUTE WARNING"
294 GOSUB 352
295 LET T1=0
296 LET C=120
297 GOTO 88
298 LET B1=B+10
299 IF B1<=100 THEN 301
300 LET B1=100
301 RETURN
302 LET Q=1.3*(A*RND(0)-1)-.06
303 LET A=1
304 IF Q>=0 THEN 307
305 LET A=0
306 LET Q=-Q
307 LET M1=M-1
308 LET G=D(A,M1)+FNT(Q)*(D(2,M1)-D(A,M1))/3.5
309 LET G=G+INT(RND(0)+.02)*A*100*RND(0)
310 LET G=INT(G)
311 RETURN
312 LET D=D+1
313 IF D=5 THEN 324
314 IF D<> 1 THEN 316
315 PRINT "1ST";
316 IF D<>2 THEN 318
317 PRINT "2ND";
318 IF D<>3 THEN 320
319 PRINT "3RD";
320 IF D<4 THEN 322
321 PRINT "4TH";
322 PRINT " AND";B1-B;" ";
323 GOTO 81
324 LET S=3-S
325 LET B=100-B
326 IF S=2 THEN 77
327 PRINT "MY ";
328 GOTO 78
329 PRINT "BALL ON ";
330 IF B=50 THEN 340
331 LET V=50-ABS(B-50)
332 LET C=C-INT(7+3*RND(0))
333 IF S=1 THEN 342
334 IF B<50 THEN 337
335 PRINT "MY ";
336 GOTO 338
337 PRINT "YOUR ";
338 PRINT V
339 RETURN
340 PRINT "THE 50"
341 RETURN
342 IF B<50 THEN 335
343 GOTO 337
344 IF S=2 THEN 347
345 PRINT "YOU";
346 GOTO 348
347 PRINT "I";
348 PRINT " KICK OFF."
349 LET F2=.06
350 LET Z2=0
351 RETURN
352 LET L=0
353 PRINT "TIMEOUT CALLED..."
354 PRINT
355 RETURN
356 IF U=0 THEN 360
357 LET U=U-1
358 GOSUB 352
359 GOTO 361
360 PRINT "..WRONG, TRY AGAIN"
361 INPUT A
362 IF ABS(INT(A))>17 THEN 360
363 LET Q=R(INT(ABS(A)))
364 IF Q=0 THEN 360
365 IF Q=100 THEN 356
366 RETURN
367 DATA .5,-2,.25,4,.5,13,.55
368 DATA .4,-2,.3,7,.65,15,.75
369 DATA .4,-2,.3,6,.6,15,.35
370 DATA .65,-2,.65,6,.6,17,.9
371 DATA .4,2,.7,10,.4,27,.2
372 DATA .1,19,.4,35,.2,100,.1
373 END