dx:=-1;
dy:=3;
repeat
setcolor(12);
circle(x,y,r);
delay(10);
setcolor(0);
circle(x,y,r);
x:=x+dx;
y:=y+dy;
if x<=x0-d+r+2 then dx:=1<br>else if y>=y0+d-r-2 then dy:=-1
else if x>=x0+d-r-2 then dx:=-1
else if y<=y0-d+r+2 then dy:=1;<br>until keypressed;
end.