Monday 21 August 2017

Auto clock Project

#include<graphics.h>
#include<stdio.h>
void clock(void);
void clock1(void);
void main()
{
int a,x,y,d,m;
d=DETECT;
initgraph(&d,&m,"C:\\TC\\BGI");
cleardevice();
setcolor(4);
clock();
for(x=303,y=150;x<=353;x=x+10)/*FROM 12 TO 1*/
    {
    setcolor(4);
    line(303,210,x,y+5);
    delay(1000);
    cleardevice();
    clock();
    }
for(x=353,y=155;x<=403,y<=180;x+=10,y+=6)/*FROM 1 TO 2*/
    {
    setcolor(4);
    line(303,210,x,y);
    delay(1000);
    cleardevice();
    clock();
    }
for(x=403,y=180;y<=250;y+=10)/*FROM 2 TO 4*/
    {
    setcolor(4);
    line(303,210,x,y);
    delay(1000);
    cleardevice();
    clock();
    }
for(x=403,y=250;x>=350,y<=270;x-=10,y+=4)/*FROM 4 TO 5*/
    {
    setcolor(4);
    line(303,210,x,y);
    delay(1000);
    cleardevice();
    clock();
    }
for(x=350,y=270;x>=250;x-=10)/*FROM 5 TO 7*/
    {
    setcolor(4);
    line(303,210,x,y);
    delay(1000);
    cleardevice();
    clock();
    }
for(x=250,y=270;x>=200,y>=250;x-=8,y-=4)/*FROM 7 TO 8*/
    {
    setcolor(4);
    line(303,210,x,y);
    delay(1000);
    cleardevice();
    clock();
    }
for(x=200,y=250;y>=170;y-=8)/*FROM 8 TO 10*/
    {
    setcolor(4);
    line(303,210,x,y);
    delay(1000);
    cleardevice();
    clock();
    }
for(x=200,y=170;x<=250,y>=150;x+=10,y-=2)/*FROM 10 TO 11*/
    {
    setcolor(4);
    line(303,210,x,y);
    delay(1000);
    cleardevice();
    clock();
    }
cleardevice();
clock1();
getch();
closegraph();
}

void clock(void)
{
setbkcolor(14);
setcolor(2);
outtextxy(350,150,"1");
outtextxy(250,150,"11");
outtextxy(300,150,"12");

outtextxy(400,170,"2");
outtextxy(400,210,"3");
outtextxy(400,250,"4");

outtextxy(350,270,"5");
outtextxy(300,270,"6");
outtextxy(250,270,"7");

outtextxy(200,250,"8");
outtextxy(200,210,"9");
outtextxy(200,170,"10");

setcolor(1);
line(180,130,420,130);
line(180,290,420,290);
line(180,130,180,290);
line(420,130,420,290);
circle(303,210,7);
setcolor(6);
setlinestyle(0,0,3);
line(303,210,303,250);
setcolor(11);
setlinestyle(0,5,2);
line(303,210,303,155);
}


void clock1(void)
{
setbkcolor(14);
setcolor(2);
outtextxy(350,150,"1");
outtextxy(250,150,"11");
outtextxy(300,150,"12");

outtextxy(400,170,"2");
outtextxy(400,210,"3");
outtextxy(400,250,"4");

outtextxy(350,270,"5");
outtextxy(300,270,"6");
outtextxy(250,270,"7");

outtextxy(200,250,"8");
outtextxy(200,210,"9");
outtextxy(200,170,"10");

setcolor(1);
line(180,130,420,130);
line(180,290,420,290);
line(180,130,180,290);
line(420,130,420,290);
circle(303,210,7);
setcolor(6);
setlinestyle(0,0,3);
line(303,210,303,250);
setcolor(11);
setlinestyle(0,5,2);
line(303,210,313,155);
setcolor(4);
line(303,210,303,155);
getch();
}

1 comment:

  1. Maybe Github would be the place to post your source code.

    If it was a decent post about linked lists that actually had plain text explaining what it's doing and why it would be of use.

    Currently it just looks like a bit of meaningless copy and paste from some homework sheet.

    There are not even comments in the code. Very unprofessional, very amature.

    ReplyDelete