Uses crt,graphABC; var x,y: integer; procedure Go(n,m: integer); begin clearwindow; setpenwidth(4); setbrushcolor(clyellow); rectangle(150,150,550,350); setpenwidth(2); setbrushcolor(clgreen); rectangle(x-50,y-50,x+50,y+50); x:=x+n; y:=y+m; sleep(1); redraw; end; beginlockdrawing; setwindowsize(700,500); hidecursor; repeat x:=150; y:=150; while x<=550 do Go (1,0); while y<=350 do Go (0,1); while x>=150 do Go (-1,0); while y>=150 do Go (0,-1); until keypressed; end.
var
x,y: integer;
procedure Go(n,m: integer);
begin
clearwindow;
setpenwidth(4);
setbrushcolor(clyellow);
rectangle(150,150,550,350);
setpenwidth(2);
setbrushcolor(clgreen);
rectangle(x-50,y-50,x+50,y+50);
x:=x+n;
y:=y+m;
sleep(1);
redraw;
end;
beginlockdrawing;
setwindowsize(700,500);
hidecursor;
repeat x:=150;
y:=150;
while x<=550 do Go (1,0);
while y<=350 do Go (0,1);
while x>=150 do Go (-1,0);
while y>=150 do Go (0,-1);
until keypressed;
end.
Так сойдет? :)