/*Simply change the path in initgraph(&gdriver, &gmode, "d:\\TC\\BGI"); e.g if your working directory is E write "E:\\TC\\BGI"*/

#include<graphics.h>
#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<dos.h>
int main()
{
	float i,k,r;
	int gdriver = DETECT, gmode,c,j,l=57,m=56;
	initgraph(&gdriver, &gmode, "d:\\TC\\BGI");
	printf("House constructed by Paritosh:");
	printf("\nFor the visibility in different colors enter any integer:  ");
	scanf("%d",&c);
	setcolor(m);
		for(i=0;i<20;i++)
		{
			delay(20);
			line(45,270-i,310,270-i);
			line(360,320-i,485,320-i);          //For foundation//
			line(310,270-i,360,320-i);
		}

		setcolor(l);
		for(i=0,j=0;i<7,j<8;i++,j++)
		{
			delay(100);
			line(45+i,250-i,310,250-i);
			line(360,300-i,485-i,300-i);
			line(310,250-i,360+i,300);
		}
		if(c==2)
		c++;
		setcolor(abs(c-2));
		for(i=0;i<5;i++)
		{
			delay(100);
			line(50+i,170-i,50+i,243);
			line(260-i,170-i,260-i,243);
			line(310+i,190+i,310+i,243+i);       //For drawing Pillers//
			line(360+i,230,360+i,293);
			line(480-i,230,480-i,293);
		}
		if(c==3)
		c--;
		setcolor(abs(c-3));
		for(i=1;i<=105;i+=2)
		{
			delay(5);
			line(50+i,169-i,50+i,169);
			line(260-i,169-i,260-i,169);
		}
		for(k=1;k<=80;k+=2)
		{
			delay(5);
			line(50+k,169,50+k,199);
			line(50+k,231,50+k,243);

		}
		for(r=1;r<=98;r+=2)
		{
			delay(5);
			line(260-r,169,260-r,199);
			line(260-r,231,260-r,243);
		}
		for(i=1;i<=29;i+=2)
		{
			delay(5);
			line(100+i,199,100+i,231);
			line(162+i,199,162+i,231);
			line(222+i,199,222+i,231);
		}
		for(i=1;i<=22;i+=2)
		{
			delay(5);
			line(50+i,199,50+i,231);
		}
		for(i=1;i<=10;i+=2)
		{
			delay(5);
			line(260-i,199,260-i,231);
			line(260+i,170+i,260+i,243);
			line(400+i,230,400+i,293);
			line(350+i,230,350+i,283+i);
		}
		for(i=1;i<=40;i+=2)
		{
			delay(50);
			line(270+i,180,270+i,243);
			line(310+i,190+i,310+i,243+i);
			line(360+i,230,360+i,293);
			line(440+i,230,440+i,293);
			line(400+i,230,400+i,234);
		}

		if(c==0 || c==16)
		c++;
		setcolor(c);
		for(i=0,k=0;i<21;i+=2,k+=.005)
		{
			delay(50);
			line(171-i,50+k,51-i,170);
		}
		for(i=204;i>0;i--)
		{
			delay(5);
			line(352-i,50,472-i,170);
		}
		for(i=0;i<=150;i++)
		{
			delay(5);
			line(460-i,180,500-i,220);
		}

		for(i=0,k=1;i<10;i+=1.5)
		{
			delay(100);
			line(147.9+k,50.2+i,268.9,170+i);
			line(269,170+i,470,170+i);
			line(310,180+i,350,220+i);
			line(350,220+i,500,220+i);
		}

		setcolor(c+1);
		for(i=1;i<3;i++)
		{
			delay(150);
			rectangle(130+i,170,160+i,243);
			rectangle(71+i,200,101-i,230);
			rectangle(192+i,200,222-i,230);    //For doors and windows//
			rectangle(410+i,235,440-i,293);
		}
		if(c==2)
		c+=2;
		setcolor(abs(c-1));
		for(i=0;i<12;i+=1.2)
		{
			delay(150);
			rectangle(134+i,172,159-i,241);
			rectangle(75+i,202,98-i,228);
			rectangle(196+i,202,219-i,228);    //For doors and windows//
			rectangle(414+i,237,437-i,291);
			outtextxy(420+i,308+i,"\n\n\n");
			outtextxy(130-i,258+i,"\n\n\n\n");
		}
	getch();
	closegraph();
	return 0;
}

Edited 5 Years Ago by Paritosh Das: n/a

This article has been dead for over six months. Start a new discussion instead.