DIM x AS INTEGER
DIM xmod AS INTEGER
DIM y AS INTEGER
DIM ymod AS INTEGER
DIM delay AS DOUBLE
DIM c AS DOUBLE
DIM linex AS INTEGER
DIM liney AS INTEGER
DIM linex2 AS INTEGER
DIM liney2 AS INTEGER
DIM dc AS INTEGER
x = 320
y = 240
xmod = 1
ymod = 1
delay = 1
c = 0
linex = 10
liney = 240
linex2 = 630
liney2 = 240
DO
x = x + xmod
y = y + ymod
liney2 = y
press$ = INKEY$
IF press$ = "a" THEN
liney = liney  8
ELSEIF press$ = "z" THEN
liney = liney + 8
END IF
IF x > 623 THEN
xmod = xmod
ELSEIF x < 17 THEN
xmod = xmod
ELSEIF y < 17 THEN
ymod = ymod
ELSEIF y > 463 THEN
ymod = ymod
ELSEIF liney + 40 = 480 THEN
liney = liney  8
ELSEIF liney  40 = 0 THEN
liney = liney + 8
END IF
REM IF (y = liney + 40 OR y = liney  40) AND (x = linex + 5 OR x = linex  5) THEN
REM xmod = xmod
REM ymod = ymod
REM END IF
SCREEN 12
CIRCLE (x, y), 17, 120
LINE (linex  5, liney  40)(linex + 5, liney + 40), 120, BF
LINE (linex2  5, liney2  40)(linex2 + 5, liney2 + 40), 120, BF
CIRCLE (x, y), 17, 0
LINE (linex  5, liney  40)(linex + 5, liney + 40), 0, BF
LINE (linex2  5, liney2  40)(linex2 + 5, liney2 + 40), 0, BF
press$ = ""
LOOP
