program p1;
uses graph,crt;
var
gd,gm,i,b:integer;
begin
b:=0;
initgraph(gd,gm,'D:\Lexa\TP\BGI');
repeat
setcolor(0);
setfillstyle(1,0);
bar(0,0,getmaxx,getmaxy);
setcolor(15);
setfillstyle(1,15);
line(250,50,390,50);
line(390,50,390,470);
line(250,50,250,470);
line(250,470,390,470);
setcolor(4);
setfillstyle(1,4);
if (b=0)or(b=1) then fillellipse(320,120,70,70)
else circle(320,120,70);
setcolor(14);
setfillstyle(1,14);
if b=1 then fillellipse(320,260,70,70)
else circle(320,260,70);
setcolor(2);
setfillstyle(1,2);
if b=2 then fillellipse(320,400,70,70)
else circle(320,400,70);
if b=3 then
for i:=1 to 5 do begin
if i mod 2=0 then setfillstyle(1,2)
else setfillstyle(1,0);
fillellipse(320,400,70,70);
delay(50000);
end;
b:=(b+1) mod 4;
delay(50000);
until keypressed;
closegraph;
end.