Uses graph, crt;
var i,dv,dm:integer;
begin
Dv:=detect;
Initgraph (dv,dm,' ');
i:=0;
Rectangle (299,325,351,75);
for i:=98 to 300 do
begin
setfillstyle (1,2);
bar (300,i,350,i);
delay (500);
setfillstyle(1,0);
bar(300,i-20,350,i-20);
delay(500);
end;
for i:=300 downto 98 do
begin
setfillstyle (1,2);
bar (300,i, 350, i);
delay (500);
setfillstyle(1,0);
bar(300,i+20,350,i+20);
delay(500);
end;
for i:=98 to 300 do
begin
setfillstyle (1,2);
bar (300,i,350,i);
delay (500);
setfillstyle(1,0);
bar(300,i-20,350,i-20);
delay(500);
end;
for i:=300 downto 98 do
begin
setfillstyle (1,2);
bar (300,i, 350, i);
delay (500);
setfillstyle(1,0);
bar(300,i+20,350,i+20);
delay(500);
end;
repeat until keypressed;
closegraph
end.