10 PRINT:PRINT:PRINT "  PING    PONG     GAME     by Jerry Silverstein
20 PRINT:PRINT:PRINT:PRINT "TO LAUNCH BALL TYPE '0' TO LAUNCH FROM LEFT PLAYER"
30       PRINT "                OR '.' TO LAUNCH FROM RIGHT PLAYER"
40 PRINT:PRINT:PRINT"  LEFT PLAYER USES 'Q' TO GO UP AND 'A' TO GO DOWN"
50     PRINT" RIGHT PLAYER USES '6' TO GO UP AND '3' TO GO DOWN"
55 PRINT"(RIGHT PLAYER SHOULD USE 10 KEY PAD FOR CONTROLS)"
60 PRINT:PRINT:PRINT"GAME CONTINUES UNTIL '0' OR '.' IS TYPED TO END GAME"
70 PRINT:PRINT"PLEASE MAKE NOTE OF SCORE BEFORE ENDING GAME SINCE "
80 PRINT"     SCREEN IS CLEARED WHEN GAME IS ENDED"
90 PRINT:PRINT"SCORE OF 1 IS GIVEN FOR RETURNING THE BALL"
100 SPEED = 10
110 PRINT" SCORE OF 10 IS GIVEN TO THE OTHER PLAYER IF BALL IS "
120 PRINT "MISSED OR BALL GOES OFF THE TABLE WHEN RETURNED   "
125 PRINT "     BEFORE GOING HALF WAY ACROSS THE TABLE":PRINT
130 INPUT "HIT RETURN TO START PLAY",A$
140 W = 23  ' WIDTH OF SCREEN (TOP TO BOTTOM) (LINES)
150 L = 49  ' LENGTH OF SCREEN (LEFT TO RIGHT) (COLUMNS)
160 T = L-3   ' PRINT TAB
170 MT = ((L/2)-3.5)  ' PRINT MESSAGE TAB
180 SC1 = 0  ' SCORE LEFT PLAYER
190 SC2 = 0  ' SCORE RIGHT PLAYER
200 D1 = 1  ' DIRECTION OF LEFT PADDLE (UP=1,DOWN=-1,NO MOVE=0)
210 D2 = 1  ' DIRECTION OF RIGHT PADDLE(UP=1,DOWN=-1,NO MOVE=0)
220 OB = &H7F  ' OUT OF BOUNDS FIELD CHARACTER
230 PD = &H0   ' PADDLE CHARACTER
240 B = &HD    ' BALL CHARACTER
250 X = 2             ' COLUMN NUMBER OF LEFT PADDLE
260 Y1 = 11:Y2 = 11     ' LINE NUMBER OF TOP OF LEFT AND RIGHT PADDLES
270 BLK = &H20        ' BLANK CHARACTER
280 CLS$= CHR$(&H1A)        ' CLEAR SCREEN CHARACTER
290 RET$= CHR$(&HD)  ' RETURN TO BEGINNING OF SAME LINE
300 PRINT CLS$;
310 FOR I = 0 TO 2
320    POKE -4096 + X +(128*(Y1 + I)),PD
330    POKE -4096 + X +(L -2)+(128*(Y2 + I)),PD   ' CREATE PADDLES
340 NEXT I
350 FOR I = -2 TO (L+2)
360    POKE -4096 +(X -1)+ I + 128,OB    ' CREATE FIELD BORDER
370    POKE -4096 +(X -1)+ I +(128*W),OB
380    POKE -4096+(X-1)+I+(128*(W+1)),OB
390 NEXT I
400 FOR I = 0 TO (W +2)
410    POKE -4096 +(X -1)+(128*I),OB  ' CREATE FIELD BORDER
420    POKE -4096 +(X -2)+(128*I),OB
430    POKE -4096 +(X + 0)+ L +(128*I),OB
440    POKE -4096 +(X -1)+ L +(128*I),OB
450    POKE -4096+(X-3)+(128*I),OB
460    POKE -4096+(X+1)+L+(128*I),OB
470 NEXT I
480 FOR I=2 TO (W-1)
490    POKE -4096+((L/2)+.5)+(128*I),&H4 'CREATE NET
500    POKE -4096+((L/2)+1.5)+(128*I),&H1
510 NEXT I
520 POKE -4096+(L-0)+(128*1),&H20
530 POKE -4096+2+(128*1),&H20
540 POKE -4096+(L-0)+(128*W),&H20
550 POKE -4096+2+(128*W),&H20
560 POKE -4096+L+1,&H20:POKE -4096+L+2,&H20 'MAKE OUTOFBOUNDS A SQUARE FIELD
570 PRINT TAB(MT);"LAUNCH BALL?";RET$;
580 LCH = 0:DIR$="NN":DW = 0:DL = 0
590 A$=""
600 A$= INKEY$
610 IF A$="" THEN 600
620 IF A$="0" THEN LCH = 1:DIR$="UR":DL = 3:DW=W-2:POKE -4096 + DL +(128*DW),B  ' LAUNCH BALL FROM LEFT
630 IF A$="." THEN LCH = 2:DIR$="DL":DL = L -1:DW=3:POKE -4096 + DL +(128*DW),B  ' LAUNCH BALL FROM RIGHT
640 IF LCH = 0 THEN 570 ELSE PRINT TAB(MT);"            ";RET$;
650 A$="":I = 0:D1 = 0:D2 = 0
660 LCH=0
670 A$= INKEY$:I = I + 1
680 IF I > SPEED THEN 740
690 IF A$="" THEN 670
700 IF A$="Q" THEN D1 = 1 ELSE IF A$="A" THEN D1 = -1 ELSE IF A$="6" THEN D2 = 1 ELSE IF A$="3" THEN D2 = -1
710 IF (A$="0")OR(A$=".")THEN PRINT CLS$:END
720 GOTO 670
730  '         MOVE PADDLES
740 IF (Y1 = 1)AND(D1 = 1) THEN D1 = 0    ' STOP PADDLES FROM MOVING OFF SCREEN
750 IF (Y2 = 1)AND(D2 = 1) THEN D2 = 0
760 IF (Y1 =(W -2))AND(D1 = -1) THEN D1 = 0
770 IF (Y2 =(W -2))AND(D2 = -1) THEN D2 = 0
780 IF D1 = 1 THEN J1 = 3:N1 = 0 ELSE IF D1 = -1 THEN J1 = -1:N1 = 2
790 IF D2 = 1 THEN J2 = 3:N2 = 0 ELSE IF D2 = -1 THEN J2 = -1:N2 = 2
800 Y1 = Y1 -D1:Y2 = Y2 -D2
810 IF D1 <> 0 THEN POKE -4096 + X +(128*(Y1 + J1)),BLK
820 IF D2 <> 0 THEN POKE -4096 + X +(L -2)+(128*(Y2 + J2)),BLK
830 PRINT "  ";SC1;TAB(T);SC2;RET$;
840 POKE -4096 + X +(128*(Y1 + N1)),PD
850 POKE -4096 + X +(L -2)+(128*(Y2 + N2)),PD
860  '              HIT BALL       SCORE
870 POKE -4096+DL+(128*DW),BLK
880 IF (DIR$="UR")OR(DIR$="DR")OR(DIR$="RR") THEN DIR = 1
890 IF (DIR$="DL")OR(DIR$="UL")OR(DIR$="LL") THEN DIR = -1
900 IF (DIR$="NN") THEN DIR = 0
910 IF DIR = 1 THEN DD = DL + 1 ELSE IF DIR = -1 THEN DD = DL -1 ELSE DD = DL
920 P = PEEK(-4096 + DD +(128*DW))
930 IF P = PD THEN P = PEEK(-4096 + DD +(128*(DW+1))) ELSE GOTO 980
940 IF P <> PD THEN IF DIR = 1 THEN DIR$="DL":DIR = -1:SC2 = SC2 + 1:GOSUB 1150  ELSE IF DIR = -1 THEN DIR$="DR":DIR = 1:SC1 = SC1 + 1:GOSUB 1150
950 IF P = PD THEN P = PEEK(-4096 + DD +(128*(DW-1))) ELSE GOTO 980
960 IF P = PD THEN IF DIR = 1 THEN DIR$="LL":DIR = -1:SC2 = SC2 + 1:GOSUB 1150  ELSE IF DIR = -1 THEN DIR$="RR":DIR = 1:SC1 = SC1 + 1:GOSUB 1150
970 IF P <> PD THEN IF DIR = 1 THEN DIR$="UL":DIR = -1:SC2 = SC2 + 1:GOSUB 1150 ELSE IF DIR = -1 THEN DIR$="UR":SC1 = SC1 + 1:GOSUB 1150
980 IF DIR$="UR" THEN DW = DW - 1:DL = DL + 3
990 IF DIR$="DR" THEN DW = DW +1:DL = DL + 3
1000 IF DIR$="DL" THEN DW = DW + 1:DL = DL -3
1010 IF DIR$="UL" THEN DW = DW -1:DL = DL -3
1020 IF DIR$="LL" THEN DL = DL -3
1030 IF DIR$="RR" THEN DL = DL + 3
1040 P = PEEK(-4096 + DL +(128* DW)) ' SCORE - OUT OF BOUNDS
1050 IF P = OB THEN IF DL >(L -4) THEN SC1 = SC1 + 10:LCH=2:GOTO 1090
1060 IF P=OB THEN IF DL < 2 THEN SC2 = SC2 + 10:LCH=1:GOTO 1090
1070 IF P=OB THEN IF DIR = 1 THEN SC2 = SC2 + 10:LCH=1:GOTO 1090
1080 IF P=OB THEN IF DIR = -1 THEN SC1 = SC1 + 10:LCH=2  
1090 IF LCH=1 THEN DIR$="UR":DL=3:DW=W-2:POKE -4096+DL+(128*DW),B
1100 IF LCH=2 THEN DIR$="DL":DL=L-1:DW=3:POKE -4096+DL+(128*DW),B
1110 IF (LCH<>1)AND(LCH<>2) THEN GOTO 1130
1120 FOR GG=1 TO 5:GOSUB 1150:FOR GGG=1 TO 35:NEXT GGG:NEXT GG
1130 POKE -4096 + DL +(128*DW),B  ' PLACE BALL AT NEW LOCATION
1140 GOTO 650
1150 '               FEEDBACK -- BALL HITS PADDLE
1160 BELLNG=5     'BELL LENGTH
1170 POKE &HEF62,&H20   'BEEPER FLAG ON
1180 PRINT CHR$(&HD);
1190 FOR BELCNT= 1 TO BELLNG:NEXT BELCNT
1200 POKE &HEF62,0
1210 PRINT CHR$(&HD);
1220 RETURN
G ON
1180 PRINT CHR$(&HD);
1190 FOR BELCNT= 1 TO BEL