C Program To Create A Gate

/////////////////////////////////////////////////////////////////////////////
//     Gate Project....                         //
/////////////////////////////////////////////////////////////////////////////
 
#include<constream.h>
#include<graphics.h>
#include<dos.h>
void main(){
 int gm, gd = DETECT;
 initgraph(&gd,&gm,"e:\\tc\\bgi");
cleardevice();
int scol,srow,ecol,erow,i,j,col;
settextstyle(10,0,5);
outtextxy(185,1,"GATE");
//pillar work
rectangle(160,112,190,253);
rectangle(360,112,390,253);
setfillstyle(1,6);
bar(161,113,189,252);
bar(361,113,389,252);
scol=161,srow=127,ecol=189,erow=127;
for(i=1;i<=9;i++){
     line(scol,srow,ecol,erow);
      for(j=1;j<=2;j++){
   line(scol,srow,ecol,erow);
     scol+=200,ecol+=200;}
        scol=161,ecol=189;
    srow+=14,erow+=14;}
col=171,srow=113,erow=126;
  for(i=1;i<=2;i++){
       for(j=1;j<=5;j++){
    line(col,srow,col,erow);
    srow+=28;
    erow+=28;
   }
   col=371,srow=113,erow=126;
    }//end of outer loop for 1st pilar
       col=179,srow=127,erow=141;
 line(col,srow,col,erow);

  for(i=1;i<=5;i++){
   for(j=1;j<=2;j++){
    line(col,srow,col,erow);
    col+=200;
   }
   col=179;
   srow+=28;
   erow+=28;

    }

 rectangle(194,134,269,246);
 rectangle(278,134,356,246);
 setcolor(15);


 line(260,246,280,246);

 line(278,126,278,246);
 line(269,126,278,126);
 setcolor(15);
 line(269,126,269,240);

// line(269,134,275,134); this is the line u were finding




 col=270,srow=134,erow=246;
  for(i=0;i<=8;i++){
 line(col,srow,col,erow);
 col++;


  }

 setcolor(0);

 line(274,134,274,180);//middle line











 //plz code here
 line(274,188,274,193);

 line(274,198,274,246);
 line(268,192,273,197);
 line(274,198,281,191);


////////////      '\/' coding
 setfillstyle(1,12);
 bar(195,135,268,245);
 bar(279,135,355,245);
 setfillstyle(1,15);

 bar(256,182,289,185);//bar for karo
 setcolor(0);
 rectangle(255,181,290,186);//rectangle for karo
 line(269,134,269,249);
 line(278,134,278,249);
 setfillstyle(1,2);
 bar(165,107,185,111);
 bar(365,107,385,111);
 setfillstyle(1,12);
 // code for globs or lights
 setcolor(15);
 line(169,106,167,98);
 line(370,106,368,98);
 line(181,106,183,98);
 line(181+201,106,183+201,98);
 line(168,97,184,97);


////////////////////////////////////////////////////////////////////////////

// filling for 1st ligth

 setcolor(12);
 line(169,96,175,90);
 line(170,96,176,90);
 line(171,96,177,90);
 line(172,96,178,90);
 line(173,96,178,91);
 line(174,96,178,92);
 line(175,96,179,92);
 line(176,96,180,92);
 line(177,96,180,93);
 line(178,96,181,93);
 line(179,96,181,94);
 line(179,96,181,95);
 line(180,96,181,95);
 line(181,96,182,95);
 line(182,96,183,95);
 line(183,96,184,96);
 setcolor(15);
 line(167,97,176,88);
 line(176,88,184,96);

////////////////////////////////////////////////////////////////////////////
// filling for second ligth
 setcolor(15);

 line(369,97,376,90);
 line(376,90,383,97);
 setcolor(12);

 line(369,98,376,91);
 line(369,99,376,92);
 line(370,99,377,92);
 line(371,99,377,93);
 line(372,99,378,93);
 line(372,100,378,94);
 line(373,100,379,94);
 line(374,99,379,95);
 line(375,99,380,95);
 line(376,99,381,96);
 line(377,99,379,96);
 line(375,92,382,97);
 line(374,93,381,97);







////////////////////////////////////////////////////////////////////////////
 setcolor(YELLOW);
 scol=170,srow=106,ecol=168,erow=98;
for(i=0;i<=6;i++){
 line(scol,srow,ecol,erow);
 line(scol+201,srow,ecol+201,erow);
 scol++,ecol++; }
 scol=180,srow=106,ecol=182,erow=98;
for(i=0;i<=7;i++){
 line(scol,srow,ecol,erow);
 line(scol+201,srow,ecol+201,erow);
 scol--; ecol--;}
 getch();
 getch();
 }
Bhanu Namikaze

Bhanu Namikaze is an Ethical Hacker, Security Analyst, Blogger, Web Developer and a Mechanical Engineer. He Enjoys writing articles, Blogging, Debugging Errors and Capture the Flags. Enjoy Learning; There is Nothing Like Absolute Defeat - Try and try until you Succeed.

No comments:

Post a Comment