10 CLS 0:SCRN 4,3:COLOR 1:P=2:R=1:C=210:D=120:E=40:F=10:INPUT N
20 CURS 40,10:RECT 211,120:X=127:Y=120:COLOR 1:A=40:B=30:B1=20:A1=80:P1=2:R1=2
30 CURS X,Y:PLOT X,Y
40 A$=INKEY$
50 IF A=>C THEN P=-N
55 IF A1=>C THEN P1=-N
60 IF B=>D THEN R=-N
65 IF B1=>D THEN R1=-N
70 IF A<=E THEN P=N
75 IF A1<=E THEN P1=N
80 IF B<=F+N THEN R=N
85 IF B1<=F+N THEN R1=N
90 COLOR 1:CURS A,B:PLOT A,B:A=A+P:B=B+R:COLOR 3
100 CURS A,B:PLOT A,B:COLOR 1:CURS A1,B1:PLOT A1,B1
105 A1=A1+P1:B1=B1+R1:COLOR 3:CURS A1,B1:PLOT A1,B1
110 CURS X,Y
120 IF A$=CHR$(48) THEN 160:REM *** Y ***
130 IF A$=CHR$(54) THEN 170:REM *** => ***
140 IF A$=CHR$(53) THEN 180:REM *** ^ ***
150 IF A$=CHR$(52) THEN 190 ELSE 40:REM *** <= ***
160 IF Y=F GOTO 210 ELSE Y=Y-N:GOTO 200
170 IF X=C GOTO 40 ELSE X=X+N:GOTO 200
180 IF Y=D GOTO 40 ELSE Y=Y+N:GOTO 200
190 IF X=E GOTO 40 ELSE X=X-N
200 PLOT X,Y:GOTO 40
210 IF C-X<=10 THEN 40 ELSE C=X-1:GOTO 200
