uses crt,dos,graph;
var
m,n,a,b,c,d:integer;
f:char;
begin
initgraph(m,n,' ');
randomize;textcolor(0);
c:=50;d:=50;m:=1;n:=1;
repeat
a:=(random(getmaxx));
b:=(random(getmaxx));
c:=c+m;d:=d+n;
setcolor(0);
if (c=49) or (c=590) then m:=m*(-1);
if (d=49) or (c=430) then n:=n*(-1);
circle(c,d,50);
d:=(random(getmaxy));
setcolor(random(16));
{line (a,b,c,d);}circle(a,b,random(70));
if keypressed then f:=readkey;
{if f=' ' then writeln('');}
until f='a';
closegraph;
end.