10 REM *** SUPER-TENNIS (c) J.SHARPE 1989/1990 20 REM ********************SET UP************************* 30 CL$=CHR$(27)+"0"+CHR$(27)+"E"+CHR$(27)+"H":PRINT CL$ 40 PRINT TAB(39);"SUPER-TENNIS" 50 : 60 TY%=6:BY%=24:LX%=22:RX%=68:REM *** COORDINATES 70 MBS=2:BAS%=1 80 DEF FNT$(X,Y)=CHR$(27)+"Y"+CHR$(Y+32)+CHR$(X+32) 90 AX%=0.5*(RX%-LX%)+LX%-2:BX%=AX%:REM **BAT A & B POSITIONS 100 X%=LX%+1:Y%=BY%-1:REM **BALL POSITION 110 W%=RX%-LX%:AM%=0:BM%=0:AP%=0:BP%=0:XS%=1:YS%=-1 120 FOR Y=TY%+1 TO BY%-2 130 PRINT FNT$(LX%-1,Y)CHR$(149)SPACE$(W%+1)CHR$(149):NEXT 140 GOSUB 420:GOSUB 440:GOSUB 470 150 REM ********************GAME******************** 160 PRINT FNT$(X%,Y%)" ":X%=X%+XS%:Y%=Y%+YS% 170 IF X%RX% THEN X%=RX% 180 PRINT FNT$(X%,Y%)CHR$(188):GOSUB 360 190 IF X%>=RX% OR X%<=LX% THEN XS%=-XS% 200 IF Y%=BY% THEN YS%=-1 :IF ABS(X%-(BX%+3))>1 THEN AP%=AP%+1:GOSUB 470 ELSE OUT 248,11:OUT 248,12:XS%=XS%+BM% 210 IF Y%=TY% THEN YS%=1 :IF ABS(X%-(AX%+3))>1 THEN BP%=BP%+1:GOSUB 470 ELSE OUT 248,11:OUT 248,12:XS%=XS%+AM% 220 IF ABS(XS%)>MBS THEN XS%=XS%-(SGN(XS%)):GOTO 220 230 IF AP%=10 OR BP%=10 THEN 290 240 BM%=FRE(""):BM%=0:A$=INKEY$ 250 IF A$="[" AND BX%>LX%-2 THEN BX%=BX%-2:BM%=-1 260 IF A$="]" AND BX%BP% THEN PRINT "******* COMPUTER WINS ********" ELSE PRINT "***** WELL DONE YOU WIN *****" 310 PRINT FNT$(27,28)"WOULD YOU LIKE TO PLAY AGAIN (Y/N)"; 320 A$=UPPER$(INKEY$) 330 IF A$="" THEN 320 ELSE IF A$="Y" THEN GOTO 10 340 END 350 REM ***************THE 'BRAINS' !!********************* 360 FOR N%=1 TO BAS%:Z1%=AX%-(LX%-2) 370 Z2%=(X%-LX%-1)+(XS%*(Y%-TY%)) 380 IF YS%=1 THEN Z2%=Z2%-XS% 390 IF Z2%<1 THEN Z2%=(1-Z2%)+1 400 IF Z2%>W% THEN Z2%=(W%-Z2%)+W% 410 AM%=-SGN(Z1%-Z2%):AX%=AX%+AM%:NEXT N% 420 PRINT FNT$(AX%,TY%)" "CHR$(154)CHR$(154)CHR$(154)" " 430 RETURN 440 PRINT FNT$(BX%,BY%)" "CHR$(154)CHR$(154)CHR$(154)" " 450 RETURN 460 REM *****************PRINT SCORE********************** 470 PRINT CHR$(7);FNT$(26,30);"SCORE: PLAYER - "BP%" COMPUTER - "AP%; 480 RETURN