1000 GOTO 1960:' @@@@@@@@@@@@@@  PONG-PONG  E.M.DAVIS 1-1-82  @@@@@@@@@@@@@@@@
1010 LY=Y:LX=X
1020 IF D>4 THEN D=D-4:IF D<1 THEN D=D+4
1030 ON D GOSUB 1350,1360,1370,1380
1040 LOCATE 25,21:PRINT RT;
1050 S=SCREEN (Y,X)
1060 IF S=47 OR S=92 GOTO  1440
1070 IF S=178 THEN GOTO 1820
1080 LOCATE LY,LX:PRINT" ":REM ERASE OLD BALL
1090 LOCATE Y,X:PRINT "@"
1100 CT= VAL(RIGHT$(TIME$,2))
1110 RT=TGT-CT: IF RT=<0 THEN GOSUB 1720
1120 IF X=3 OR X=78 OR Y=2 OR Y=23 THEN GOSUB 1700
1130 REM CHECK KEYBOARD
1140 K$=INKEY$:IF K$="" THEN K$="."
1150 KY= ASC(K$)
1160 IF KY=47  GOTO 1540
1170 IF KY=92 GOTO 1580
1180 GOTO 1010
1190 END
1200 REM INIT FUNCTIONS
1210 CLS
1220 COLOR 0,7:CLS
1230 TIME$="00:00:00"
1240 A=1:Y=5:X=40:D=2
1250 TY%=10:TX%=10
1260 LOCATE 1,2:PRINT"??";
1270 FOR I=1 TO 74:PRINT"?";:NEXT I
1280 PRINT"?"
1290 FOR I=1 TO 22:PRINT" ?" SPC(76) "?" :NEXT I
1300 PRINT" ??";
1310 FOR I=1 TO 75:PRINT "?";:NEXT I
1320 PRINT "?";
1330 RETURN
1340 REM DIRECTION SWITHES
1350 Y=Y-1:GOTO 1390
1360 X=X+1:GOTO 1390
1370 Y=Y+1:GOTO 1390
1380 X=X-1:GOTO 1390
1390 IF X>78 THEN X=78
1400 IF X<3 THEN X=3
1410 IF Y>23 THEN Y=23
1420 IF Y<2 THEN Y=2
1430 RETURN
1440 REM HIT PADDLE ROUTINE
1450 IF S=47 AND (D=1 OR D=3) THEN GOTO 1480
1460 IF S=92 AND (D=2 OR D=4) THEN GOTO 1480
1470 D=D-2
1480 D=D+1
1490 SOUND 60,1
1500 LOCATE LY,LX:PRINT" "
1510 IF D>4 THEN D=D-4
1520 IF D<1 THEN D=D+4
1530 GOTO 1030
1540 REM PLACE PADDLE PLACEMENT HERE
1550 LOCATE Y,X:PRINT "/"
1560 IF D=1 OR D=3 THEN GOTO 1610
1570 D=D-2:GOTO 1610
1580 LOCATE Y,X:PRINT "\"
1590 IF D=2 OR D=4 THEN GOTO 1610
1600 D=D-2
1610 D=D+1
1620 IF D>4 THEN D=D-4
1630 IF D<1 THEN D=D+4
1640 ON D GOSUB 1350,1360,1370,1380
1650 LOCATE LY,LX:PRINT" "
1660 S=SCREEN(Y,X):IF S=178 THEN GOTO 1820
1670 LOCATE Y,X:PRINT "@"
1680 LY=Y:LX=X
1690 GOTO 1050
1700 D=D+2:IF D>4 THEN D=D-4
1710 SOUND 38,2: RETURN
1720 LOCATE TY%,TX%:PRINT" ";
1730 TY%=2+20*RND(3):TX%=4+72*RND(4)
1740 COLOR 16,7
1750 LOCATE TY%,TX%:PRINT"?";
1760 PLAY"MBA16B16A16B16"
1770 TIME$="00"
1780 COLOR 0,7
1790 LOCATE 25,60:PRINT BAL;
1800 BAL=BAL+1:IF BAL=6  GOTO 2560
1810 RETURN
1820 REM ********** SCORE AND WINNER CIRCLE ***************
1830 SCORE=SCORE+1
1840 PLAY "MSL16ABCDEFGABCDEFGABCDEFGP8C8P8C8P8C4"
1850 IF BAL<5 GOTO 2510
1860 CLS:LOCATE 5,30:PRINT "CONGRATULATIONS"
1870 LOCATE 10,15:PRINT" YOU HAVE HIT ";SCORE;" TARGETS USING ";TGT;" SECONDS/TARGET."
1880 IF BAL<5 GOTO 20
1890 LOCATE 24,20:PRINT"DO YOU WISH TO PLAY AGAIN (Y/N)? ";:
1900 DEF SEG:POKE 106,0
1910 IN$=INKEY$:IF IN$="" GOTO 1910
1920 IF IN$="Y" OR IN$="y" THEN GOTO 2360
1930 IF IN$="N" OR IN$="n" THEN CLS:LOCATE 12,35:COLOR 7,0:PRINT "BYE":CHAIN "MENU",1000
1940 GOTO 1910
1950 END
1960 REM INITIAL INSTRUCTIONS
1970 DEFINT M:COMMON MENU
1980 SCREEN 0,0,0:WIDTH 80:KEY OFF
1990  COLOR 7,0:CLS:LOCATE ,,0
2000 RANDOMIZE VAL(RIGHT$(TIME$,2))
2010 CLS
2020 LOCATE 5,28:PRINT" THE DAVIS PONG-PONG GAME "
2030 COLOR 0,7
2040 FOR Y=10 TO 20
2050 LOCATE Y,22:PRINT "                                       ";:NEXT Y
2060 PRINT;
2070 Y=15:X=30:LY=14:LX=29:XX=1:YY=1
2080 LOCATE LY,LX:PRINT "?";
2090 LOCATE Y,X:PRINT "?";
2100 LY=Y:LX=X
2110 X=X+XX:IF X>59 THEN XX=-1
2120 IF X<23 THEN XX=1
2130 Y=Y+YY:IF  Y>19 THEN YY=-1
2140 IF Y<11 THEN YY=+1
2150 COLOR 7,0
2160 LOCATE 25,25:PRINT "PRESS ANY KEY FOR INSTRUCTIONS" ;
2170 POKE 106,0
2180 IN$=INKEY$:IF IN$="" GOTO 2080
2190 CLS
2200 LOCATE 5,10:PRINT"You are about to play a game of PONG-PONG. The object of the
2210 PRINT" game is to HIT a target with a moving ball.  Of course the target will not
2220 PRINT" stay still .  The ball's direction is controlled by inserting paddles in its"
2230 PRINT" path.  To make the game more interesting the paddles remain on the gameboard.
2240 PRINT"
2250 PRINT"       You can control the games difficulty by choosing the length of time the
2260 PRINT" target will remain in one location. You will be given FIVE targets.
2270 PRINT'
2280 PRINT"       The paddles are placed using keys '/' and '\' on the right and left
2290 PRINT" bottom row of keys.  They will place a paddle at the balls current location.
2300 PRINT
2310 PRINT"      The TARGET will look like :";:COLOR 23,0:PRINT"?";:COLOR 7,0
2320 PRINT"
2330 PRINT"      The BALL will look like :@"
2340 LOCATE 25,20:PRINT" PRESS ANY KEY TO START GAME ";
2350 AN$= INKEY$:IF AN$="" GOTO 2350
2360 REM @@@@@@@@@@ SET TARGET TIMES@@@@@@@@@@
2370 CLS:BAL=1:SCORE=0
2380 LOCATE  5,15:PRINT" It is now time to choose the 'TARGET TIMES'.."
2390 LOCATE 8,6:PRINT "If you have just played a game the taget time was :";TGT;"seconds."
2400 PRINT"":PRINT""
2410 PRINT "   HOW MANY SECONDS (1-60) DO YOU WISH ?
2420 PRINT :PRINT
2430 PRINT "      5= OUTSTANDING
2440 PRINT "     10= EXPERT
2450 PRINT "     20= VERY GOOD
2460 PRINT "     30= NORMAL
2470 PRINT "     50= BEGINNER
2480 PRINT :PRINT :PRINT
2490 PRINT "    YOUR TIME (1-60) ";:INPUT TGT
2500 IF TGT <1 OR TGT >60 GOTO 2490
2510 GOSUB 1200:REM SET UP
2520 TIME$="00:00:00"
2530 LOCATE 25,25:PRINT"SECONDS REMAINING ON TARGET NUMBER ";
2540 GOSUB 1720:REM PLACE TARGET
2550 GOTO 1010
2560 '******* PLAYED 5 TARGETS *****
2570 IF SCORE>0 GOTO 1820
2580 CLS
2590 COLOR 23,0: LOCATE 5,31:PRINT " SORRY YOU LOSE "
2600 COLOR 7,0:DEF SEG:POKE 106,0
2610 LOCATE 10,25:PRINT "> YOU USED-UP YOUR FIVE TARGETS <"
2620 LOCATE 24,20:PRINT "DO YOU WISH TO PLAY ANOTHER GAME (Y/N) ?";
2630 AN$=INKEY$:IF AN$="" GOTO 2630
2640 IF AN$="Y" OR AN$="y" GOTO 2360
2650 IF AN$="N" OR AN$="n" THEN CLS:LOCATE 10,35:PRINT" GOOD BYE":CHAIN "MENU",1000
2660 GOTO 2630
2670 '@@@@@@@@@@@@@@@@  PONG-P0NG  ED DAVIS  @@@@@@@@@@@@@@@@@@@@@@@
2680 '@                                                            @
2690 '@       OK, it's not that great but what do you want for     @
2700 '@       a late Friday evenings work?  Please send improv-    @
2710 '@       ments.  Burlington, ext.(8-446)-2091. Thanks.        @
2720 '@                                                            @
2730 '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@