#include<graphics.h>
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<time.h>
main()
{
int gdrive,gmode;
int i,j,x,y,xor;
int clr;
int clrs[10]={1,2,4,5,9,10,11,12,13,14};
time_t t1,t2,st;
double tick;
gdrive=DETECT;
initgraph(&gdrive,&gmode,"C:\\Win-TC");
setbkcolor(15);
t1=time(NULL);
t2=time(NULL);
st=t2;
xor=1;
x=50;
y=50;
while(difftime(t2,st)<60)
{
t2=time(NULL);
if(difftime(t2,t1)>0.5)
{
t1=t2;
clr=0;
for(i=0;i<14;i++)
{
setcolor(clrs[clr]);
circle(x,y,5);
setfillstyle(1,clrs[clr]);
floodfill(x,y,clrs[clr]);
xor=1;
if(x<110&&y==50){x=x+15; xor=0;}
if(x==110&&y<95&&xor){y=y+15;xor=0;}
if(x>50&&y==95&&xor){x=x-15;xor=0;}
if(x==50&&y>50&&xor){y=y-15;xor=0;}
clr++;
clr=clr%10;
}
clr=clrs[9];
for(i=9;i>0;i--){clrs[i]=clrs[i-1];}
clrs[0]=clr;
}
}
getch();
closegraph();
}