5PRINT"THIS IS AN UNREAL PDP11 BASEBALL GAME."
6PRINT
7PRINT
10PRINT"IF YOU NEED INSTRUCTIONS, TYPE A 1"
11INPUTP
12IFP<>1GOTO47
15PRINT
16PRINT"YOU WILL BE PLAYING BASEBALL AGAINST THE TEAM PDP11,"
18PRINT"WHEN AT BAT YOU WILL BE ALLOWED THE FOLLOWING:"
19PRINT"TYPE","NUMBER"
20PRINT"LIGHT SWING","0"
21PRINT"CHECKED SWING","1"
22PRINT"BUNT","2"
23PRINT"NO SWING","3"
24PRINT"FULL SWING","4"
25PRINT
26PRINT
27PRINT"WHEN YOU ARE PITCHING YOU MAY THROW THE FOLLOWING:"
28PRINT"TYPE","NUMBER"
29PRINT"CURVE","0"
30PRINT"FASTBALL","1"
31PRINT"SLIDER","2"
32PRINT"KNUCKLE BALL","3"
33PRINT"BALL","4"
34PRINT"PICK-OFF","5"
35PRINT
36PRINT"WHEN ASKED FOR THE TYPE OF PITCH OR SWING, JUST TYPE THE NUMBER"
37PRINT"OF THE PITCH OR SWING THAT YOU WANT."
38PRINT
39PRINT"WATCH OUT FOR SPITBALLS, GOOD LUCK, AND..."
40PRINT 
41PRINT
42PRINT,"PLAY BALL!!"
43PRINT
44PRINT
47LETZ=0:LETI=1
48LETD=0:LETE=0:LETF=0:LETG=0:LETI=0:LETO=0:LETS=0:LETW=0:LETY=0:LETX=0
49DIMJ(4,4)
50DATA0,4,5,6,8,0,4,5,6,9,0,4,5,6,8,2,4,5,6,7,1,3,3,3,1
51FORC=0TO4
52FORB=0TO4
53READK
54LETJ(B,C)=K
55NEXTB
56NEXTC
57RANDOMIZE
58LETI=1:LETH=0
100PRINT"IF YOU WISH TO BE THE HOME TEAM,INPUT A 1"
101PRINT"ELSE PUT IN A 0"
102INPUTA
105RANDOMIZE
106IFA=1GOTO120
110PRINT"SWING"
111INPUT B
112IFB>4GOTO110
113IFX=1GOTO620
115LETC=INT((4-0)*RND(8)+0)
116GOTO140
120PRINT"PITCH"
121INPUT C
122IFC>5GOTO120
123IFC=5GOTO674
124IFX=5GOTO650
125LETB=2
126IFRND(8)<.4THENLETB=0
127IFRND(8)>.6THENLETB=4
140IFJ(B,C)=1GOTO250
145IFJ(B,C)=3THENGOTO315
146IFJ(B,C)=0GOTO195
147IFJ(B,C)=2THENGOTO190
148IFJ(B,C)=4GOTO185
149IFJ(B,C)=5GOTO195
150IFJ(B,C)=6GOTO180
151IFJ(B,C)=7GOTO155
152IFJ(B,C)=8GOTO175
153IFJ(B,C)=9THENGOTO170
155IFRND(8)<.5GOTO400
156GOTO430
167GOTO315
170IFRND(8)<.15THENGOTO505
171GOTO250
175IFRND(8)<.5GOTO195
176IFRND(8)<.3GOTO445
177IFRND(8)<.4GOTO475
178GOTO430
180IFRND(8)<.7GOTO250
181GOTO315
185IFRND(8)<.5THENGOTO400
186IFRND(8)<.5GOTO250
190IFRND(9)<.3GOTO525
191IFRND(8)<.4GOTO370
194GOTO315
195IFRND(8)<.3GOTO525
196IFRND(8)<.4GOTO370
197GOTO250
200IFO=3THENGOTO220
201IFA=0THENLETF=F+S
202IFA=1THENLETG=G+S
203PRINT;O;"OUTS"
204IFS>0THENPRINT,S,"RUNS SCORED":LETS=0
205IFX+Y+Z=0THENPRINT"NO MEN ON BASE"
206IFX+Y+Z=3THENPRINT"BASES LOADED"
207IFX+Y+Z=3GOTO105
208IFX+Y+Z=0GOTO105
209PRINT"RUNNER ON"
210IFX=1THENPRINT "FIRST"
211IFY=1THEN PRINT "SECOND"
212IFZ=1THENPRINT "THIRD"
213GOTO105
220PRINT"THE SIDE IS RETIRED."
221IFH=0GOTO230
222LETH=0
223LETI=I+1
224IFI<10THENGOTO226
225GOTO300
226PRINT
227PRINT"TOP OF INNING";,I
228GOTO235
229GOTO243
230LETH=1
231IFI<9GOTO233
232IFG>FGOTO300
233PRINT
234PRINT"BOTTOM OF INNING ";,I
235PRINT"THE SCORE IS PDP11";,G,"YOU";,F
236LETO=0:LETX=0:LETY=0:LETZ=0:LETS=0
237IFA=0THENLETA=1:GOTO105
238IFA=1THENLETA=0:GOTO105
240PRINT"INNING";,I
241LETH=0
242IFI=9GOTO300
243LETS=0:LETO=0:LETX=0:LETY=0:LETZ=0
244GOTO105
250LETE=E+1
255IFE=3THENPRINT"STRIKE THREE!! YOU ARE OUT!!!"
260IFE=3THENLETO=O+1
264IFE=3THENLETD=0
265IFE=3THENLETE=0
270IFE<>3THENPRINT;,D,"BALLS";,E,"STRIKES"
275GOTO200
300GOTO689
315LETD=D+1
316IFD=4GOTO325
317PRINT
318PRINT;,D,"BALLS";,E,"STRIKES"
319GOTO105
325LETD=0
326PRINT"A MAN WALKED"
327LETD=0:LETE=0
330IFX+Y+Z=3THENLETS=S+1
335IFX+Y+Z=3GOTO200
340IFX+Y=2THENLETZ=1
345IFX+Y=2GOTO105
350IFX=1THENLETY=1
355IFX=1GOTO105
360LETX=1
365GOTO105
370PRINT"THE HIT IS A SINGLE!"
375IFZ=1THENLETS=S+1
380LETZ=0
385IFY=1THENLETZ=1:LETY=0
390IFX=1THEN LETY=1
391LETD=0:LETE=0
392LETX=1
395GOTO200
400IFE=2THENPRINT"FOULED BACK"
405IFE=2GOTO105
410LET E=E+1
415PRINT"FOUL BALL, STRIKE";,E
420PRINT;,D,"BALLS";,E,"STRIKES"
425GOTO105
430PRINT"BALL POPPED UP AND WAS CAUGHT!"
435LETO=O+1
436LETE=0:LETD=0
440GOTO200
445PRINT"IT'S A DOUBLE!!!"
450IFZ=1THENLETS=S+1
451LETZ=0
455IFY=1THENLETS=S+1
456LETY=1
460IFX=1THEN LET Z=1
461LETD=0:LETE=0
465LETX=0
470GOTO200
475PRINT"IT'S A TRIPLE!!!"
480LETS=X+Y+Z
485LETZ=1:LETY=0:LETX=0
490IFX=1THENLETS=S+1:LETX=0
491LETD=0:LETE=0
500GOTO200
505PRINT"IT'S A HOME RUN!!!!!"
510LETS=X+Y+Z+1
515LETX=0:LETY=0:LETZ=0
516LETD=0:LETE=0
520GOTO200
525IFX=1GOTO550
526IFO=2GOTO600
529PRINT"IT'S A GROUND OUT!"
530IFRND(9)<.5GOTO540
531IFX+Y+Z>1THENPRINT"THE RUNNERS ADVANCE."
532IFZ=1THEN LETS=S+1:LETZ=0
533IFY=1THENLETZ=1:LETY=0
534IFX=1THENLETY=1
535LETX=0
536LETO=O+1
537LETD=0:LETE=0
538GOTO200
540GOTO536
550IFRND(8)<.3GOTO555
551GOTO529
555IFO=2GOTO600
556PRINT"DOUBLE PLAY!!"
560LETO=O+2
565LETX=0
570IFZ=1THENLETS=S+1
575LETZ=0
580IFY=1THENLETZ=1
585LETY=0
590LETD=0:LETE=0
595GOTO200
600PRINT"GROUND OUT"
605LETO=O+1
610LETE=0:LETD=0
615GOTO200
620IFY=1GOTO115
625IFRND(9)<.25GOTO640
626IFRND(8)<.8GOTO115
627PRINT" THE RUNNER STOLE SECOND BASE!!"
628LETX=0:LET Y=1
629GOTO110
640PRINT"THE RUNNER WAS PICKED OFF OF FIRST BASE!!"
645LETO=O+1
646LETX=0
647IFO=3GOTO220
648GOTO105
650IFRND(9)<.65GOTO125
655IFY=1GOTO125
660PRINT"THE RUNNER STOLE SECOND BASE!!"
665LETX=0:LETY=1
670GOTO120
674IFX=0GOTO120
675IFRND(9)<.85GOTO685
676PRINT"THE RUNNER WAS PICKED OFF FIRST"
677LETO=O+1
678IFO=3GOTO220
679LETX=0
680GOTO120
685PRINT"THE RUNNER WAS BACK IN TIME"
686GOTO120
689PRINT"THE FINAL SCORE IS PDP11 ";,G,"YOU ";,F
690END
