#include<stdio.h>
#include<conio.h>
#include<conio.h>
#include<dos.h>
#include<graphics.h>
#include<math.h>
#include<stdlib.h>
void main()
{
int gd=DETECT,gm,h1=9,m1=0,s1=1;
unsigned long i,n;
char t[1000];
float sec=-1057,m=-1.57,h=-3.41;
initgraph(&gd,&gm,"c:\\tc\\bgi");
settextstyle(2,0,26);
for(i=0;i<=20;i++)
{
setcolor(i);
outtextxy(80,80,"wall clock");
delay(300);
outtextxy(180,240,"sandeep");
outtextxy(60,300,"cool sandy 3@icqmail.com");
}
clearviewport();
for(i=1;i<=10;i+=3)
{
setcolor(BLUE);
setlinestyle(0,0,2);
circle(320,240,190+i);
setcolor(GREEN);
circle(320,240,210+i);
{
setfillstyle(SOLID_FILL,BLACK);
setcolor(YELLOW);
setlinestyle(0,0,3);
line(320,240,320+130*cos(-m),240-130*sin(-m));
fillellipse(320+130*cos(-m),240-130*sin(-m),4,4);
setcolor(MAGENTA);
setlinestyle(0,0,3);
line(320,240,320+100*cos(-h),240-100*sin(-h));
fillellipse(320+100*cos(-h),240-100*sin(-h),4,4);
setlinestyle(0,0,2);
settextstyle(2,0,4);
float angle=-1.571428;
for(i=1;i<=12;i++)
{
setcolor(i);
angle=angle+5*0.104666;
sprintf(t,"%d",i);
float x=320+180*cos(-angle);
float y=240-180*sin(-angle);
outtextxy(x,y,t);
}
outtextxy(10,10,"press any key to quit");
//start clock
i=0;
do
{
sound(3800);//tick tick tick
delay(1000);
nosound();
setcolor(YELLOW);
fillellipse(320,240,6,6);
fillellipse(320,240,3,3);
setcolor(BLUE);
line(320,240,320+180*cos(-sec),240-180*sin(-sec));
delay(800);
setcolor(0);
line(320,240,320+180*cos(-sec),240-180*sin(-sec));
setfillstyle(SOLID_FILL,BLACK);
bar(260,465,380,490);
if(i%60==0)
{
setcolor(BLACK);
setlinestyle(0,0,3);
m=m-.1046666;
line(320,240,320+130*cos(-m),240-130*sin(-m));
fillellipse(320+130*cos(-m),240-130*sin(-m),4,4);
m=m+.1046666;
setcolor(YELLOW);
setlinestyle(0,0,3);
line(320,240,320+130*cos(-m),240-130*sin(-m));
fillellipse(320+130*cos(-m),240-130*sin(-m),4,4);
setlinestyle(0,0,2);
m=m+.1046666;
}
if(i%720==0 && i!=0)
{
setcolor(BLACK);
setlinestyle(0,0,3);
h=h-.1046666;
line(320,240,320+100*cos(-h),240-100*sin(-h));
fillellipse(320+100*cos(-h),240-100*sin(-h),4,4);
h=h+.1046666;
line(320,240,320+100*cos(-h),240-100*sin(-h));
fillellipse(320+100*cos(-h),240-100*sin(-h),4,4);
h=h+.1046666;
setcolor(MAGENTA);
setlinestyle(0,0,3);
line(320,240,320+100*cos(-h),240-100*cos(-h));
fillellipse(320+100*cos(-h),240-100*sin(-h),4,4);
setlinestyle(0,0,2);
h=h+.1046666;
}
sec=sec+.1046666;
i++;
sprintf(t,"%d: %d: %d:",h1,m1,s1);
setcolor(YELLOW);
outtextxy(290,465,t);
s1=s1+1;
if(s1==60)
{m1=m1+1;s1=0;}
if(m1==60)
{h1=h1+1;m1=0;}
setfillstyle(11,gd+1);
}while(!kbhit());
outtextxy(240,280,"T I M E---UP");
getch();
}
}
}
No comments:
Post a Comment