Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 nimated Door
Index -> Programming, C++ -> C++ Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
rickdragon




PostPosted: Tue Jan 13, 2004 2:05 pm   Post subject: nimated Door

#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<dos.h>
#include<graphics.h>
void POLY(int s,float h[15][2]);
void main()
{
int gd=DETECT,gm,s,i,a=8;
float h[15][2];
initgraph(&gd,&gm,"c:\\tc\\bgi");
h[0][0]=100; h[0][1]=100;
h[1][0]=350; h[1][1]=100;
h[2][0]=350; h[2][1]=400;
h[3][0]=100; h[3][1]=400;
POLY(4,h);
getch();
h[0][0]=100; h[0][1]=100;
h[1][0]=300; h[1][1]=150;
h[2][0]=300; h[2][1]=450;
h[3][0]=100; h[3][1]=400;
POLY(4,h);
setcolor(0);
line(100,400,300,400);
getch();
do
{
for(i=1;i<2;i++)
{
setcolor(BLACK);
POLY(4,h);
for(int j=0;j<=1;j++)
{
h[i][0]+=5;
h[i][1]-=5;
h[i+1][0]+=5;
h[i+1][1]-=5;
if(h[i][1]<100)
goto esc;
}
setcolor(0);
line(100,400,300+a,400);
a=a+12;
setcolor(WHITE);
POLY(4,h);
delay(1000);

}
}while(1!=2);
esc:
setcolor(WHITE);
h[0][0]=100; h[0][1]=100;
h[1][0]=350; h[1][1]=100;
h[2][0]=350; h[2][1]=400;
h[3][0]=100; h[3][1]=400;
POLY(4,h);
setcolor(WHITE);
h[0][0]=105; h[0][1]=105;//last poly
h[1][0]=345; h[1][1]=105;
h[2][0]=345; h[2][1]=395;
h[3][0]=105; h[3][1]=395;
POLY(4,h);
getch();
closegraph();
}

void POLY(int s,float h[15][2])
{
int i;
for(i=0;i<s-1;i++)
{
line(h[i][0],h[i][1],h[i+1][0],h[i+1][1]);
}
line(h[0][0],h[0][1],h[s-1][0],h[s-1][1]);

}
Sponsor
Sponsor
Sponsor
sponsor
G-lant




PostPosted: Sun Feb 29, 2004 2:55 pm   Post subject: (No subject)

What does the door do?? I dont have a compiler so what does it do??? please tell me. Confused
Display posts from previous:   
   Index -> Programming, C++ -> C++ Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: