Flag Coding

#include<graphics.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
#include<bios.h>
#include<stdio.h>
#include<math.h>

    aruba()
   {

  setfillstyle (1,15);
  rectangle (225,300,470,155);
  setfillstyle(SOLID_FILL, LIGHTBLUE);
  floodfill(226,250, WHITE);
  setfillstyle(1, YELLOW);
  bar (225,260,470,270);
  bar (225,240,470,250);
  line (245,190,250,170);
  line (258,190,250,170);
  line (258,190,275,195);
  line (258,205,275,195);
  line (258,205,250,225);
  line (245,205,250,225);
  line (230,195,245,205);
  line (230,195,245,190);
  setfillstyle(SOLID_FILL, RED);
  floodfill (245,191, WHITE);



  bar(220,150,225,440);
  setfillstyle (1, WHITE);
  bar(200,440,245,450);

  rectangle(190,450,260,460);
  setfillstyle (1, GREEN);
  bar(175,460,275,470);

  settextstyle(8,0,6);

  outtextxy(100,5,"ARUBA FLAG");


 }

  pakistan()
 {
  setfillstyle(1,2);

  bar(270,245,400,155);

  setfillstyle(1,15);

  bar(225,245,270,155);

  setfillstyle(1,15);

  setcolor(15);

  circle(320,200,30);

  floodfill(320,201,15);


  setfillstyle(1,2);

  setcolor(2);

  circle(330,190,30);

  floodfill(331,191,2);
  setcolor(WHITE);
  setfillstyle(1,15);
  line (330,180,360,180);
  line (345,200,360,180);
  line (330,180,345,200);
  setfillstyle(SOLID_FILL, WHITE);
  floodfill(345,181,WHITE);

  setfillstyle(1,15);
  line (360,195,330,195);
  line (345,170,330,195);
  line (345,170,360,195);
  setfillstyle(SOLID_FILL, WHITE);
  floodfill(345,171, WHITE);


  setfillstyle(1, GREEN);
  bar(220,150,225,440);
  setfillstyle (1, WHITE);
  bar(200,440,245,450);

  rectangle(190,450,260,460);
  setfillstyle (1, GREEN);
  bar(175,460,275,470);

  settextstyle(8,0,4);

  outtextxy(200,20,"PAKISTANI FLAG");


 }


  australia()
 {
  settextstyle(3,3,4);
  outtextxy(340,160,"*");
  settextstyle(3,3,4);
  outtextxy(360,180,"*");
  settextstyle(3,3,3);
  outtextxy(350,200,"*");
  settextstyle(3,3,4);
  outtextxy(335,220,"*");
  settextstyle(3,3,4);
  outtextxy(320,185,"*");
  settextstyle(3,3,5);
  outtextxy(255,220,"*");

  setfillstyle(1,15);

  rectangle (225,245,400,155);
  setfillstyle(SOLID_FILL, BLUE);
  floodfill(226,156, WHITE);


  setfillstyle(SOLID_FILL, RED);
  bar (225,190,320,175);
  setfillstyle(SOLID_FILL, WHITE);



  setfillstyle(SOLID_FILL,RED);
  bar (265,210,285,155);


  line (225,155,320,210);

  line (225,210,320,155);
  setfillstyle (1,RED);
  bar(220,150,225,440);

  rectangle(200,440,245,450);
  rectangle(190,450,260,460);
  rectangle(175,460,275,470);

  settextstyle(3,0,6);

  outtextxy(200,25,"AUSTRALIAN FLAG ");

 }

  india()
  {

  setfillstyle(1,6);
  bar(225,125,356,155);

  setfillstyle (1,7);
  bar (225,155,355,185);

  setfillstyle(1,2);
  bar(225,185,355,215);


  rectangle(220,120,225,440);


  rectangle(200,440,245,450);
  rectangle(190,450,260,460);
  rectangle(175,460,275,470);

  circle(291,170,13);

  line(291,158,291 ,183);
  line(279,170,303,170);
  line(282,160,300,180);
  line(282,180,300,160);

  settextstyle(3,0,7);

  outtextxy(200,15,"INDIAN FLAG");


 }
  puerto()

  {

  rectangle(225,350,500,155);

  line (225,155,370,250);
  line (225,350,370,250);

  line (240,250,260,250);
  line (270,230,260,250);
  line (270,230,280,250);
  line (280,250,300,250);
  line (280,270,300,250);
  line (280,270,290,290);
  line (270,280,290,290);
  line (270,280,250,300);
  line (255,270,250,300);
  line (240,250,255,270);

  setfillstyle(SOLID_FILL, BLUE);
  floodfill(240,251,WHITE);

  setfillstyle(SOLID_FILL, WHITE);
  floodfill(256,271,WHITE);


  line (280,190,500,190);
  setfillstyle(SOLID_FILL, RED);
  floodfill(280,160, WHITE);
  setfillstyle (SOLID_FILL, 7);
  floodfill(300,200, WHITE);

  line (340,230,500,230);
  setfillstyle(SOLID_FILL, RED);
  floodfill (342,231, WHITE);

  setfillstyle (1,15);
  line (340,270,500,270);
  setfillstyle(SOLID_FILL, 7);
  floodfill (341,271, WHITE);


  line (280,310,500,310);
  setfillstyle(SOLID_FILL, RED);
  floodfill (300,311, WHITE);


  setfillstyle(1, GREEN);
  bar(220,150,225,460);



  setfillstyle (1, WHITE);
  bar(175,460,275,470);

  settextstyle(8,0,6);

  outtextxy(200,30,"PUERTO FLAG");


   }

   reunion()
   {
  rectangle(225,320,490,155);
  setfillstyle(1,15);
  line (225,155,490,320);
  line (225,320,490,155);
  setfillstyle(SOLID_FILL, 6);
  floodfill(230,156,WHITE);

  setfillstyle(SOLID_FILL, BLUE);
  floodfill(265,200, WHITE);

  setfillstyle(SOLID_FILL, GREEN);
  floodfill(295,280, WHITE);

  setfillstyle(SOLID_FILL, RED);
  floodfill(450,280, WHITE);

  circle (360,240,50);
  setfillstyle(SOLID_FILL, WHITE);
  floodfill(400,241, WHITE);

  setfillstyle(SOLID_FILL, WHITE);
  floodfill(361,241, WHITE);

  setfillstyle(SOLID_FILL, WHITE);
  floodfill(320,241, WHITE);

  setfillstyle(SOLID_FILL, WHITE);
  floodfill(380,220, WHITE);

  setfillstyle(1, RED);
  bar(205,155,225,320);

  setfillstyle(1, WHITE);
  bar(185,155,205,320);

  setfillstyle(1, BLUE);
  bar(165,155,185,320);

  setfillstyle(1, GREEN);
  bar(155,150,165,460);


  setfillstyle (1, LIGHTRED);
  bar(115,460,215,470);

  settextstyle(8,0,6);

  outtextxy(200,20,"REUNION FLAG");


  }

  botswana()
  {

  setfillstyle(1,BLUE);
  bar (225,230,500,155);
  setfillstyle(1,WHITE);
  bar (225,230,500,240);
  setfillstyle(1,WHITE);
  bar (225,290,500,300);
  setfillstyle(1,BLUE);
  bar (225,300,500,360);


  setfillstyle(1, GREEN);
  bar(220,150,225,460);


  setfillstyle (1, WHITE);
  bar(170,460,275,470);

  settextstyle(8,0,6);

  outtextxy(100,5,"BOTSWANA FLAG");

  }


  south()
  {

  rectangle(225,350,500,155);

  line (225,205,280,240);
  line (225,285,280,240);

  setfillstyle(1,WHITE);
  line (226,190,300,240);
  line (226,310,300,240);
  setfillstyle(SOLID_FILL, YELLOW);
  floodfill(226,191,WHITE);

  line (360,210,270,155);
  line (360,210,500,210);
  line (355,220,255,155);
  line (355,220,500,220);
  setfillstyle(SOLID_FILL, WHITE);
  floodfill (360,211, WHITE);

  setfillstyle (SOLID_FILL, RED);
  floodfill(316,156,WHITE);

  line (260,350,350,260);
  line (350,260,500,260);
  line (275,350,350,275);
  line (350,275,500,275);
  setfillstyle(SOLID_FILL, WHITE);
  floodfill (350,261, WHITE);


  setfillstyle(SOLID_FILL, BLUE);
  floodfill (350,276, WHITE);

  setfillstyle(SOLID_FILL, GREEN);
  floodfill (226,156, WHITE);

  settextstyle(3,0,2);

  outtextxy(200,30,"SOUTH AFRICA FLAG");


  rectangle(220,155,225,470);
  setfillstyle(SOLID_FILL, RED);
  floodfill (221,156, WHITE);
  return(0);

  }


  uae()
  {
 setfillstyle (1,GREEN);
 bar (225,220,500,155);
 setfillstyle(1,WHITE);
 bar (225,280,500,220);

 line (225,330,500,330);
 line (225,330,225,250);
 line (500,330,500,250);

 setfillstyle(1, RED);
 bar(120,155,225,332);


     setfillstyle(1, GREEN);
 bar(120,150,110,460);
 setfillstyle (1, WHITE);
 bar(70,450,160,460);
 setfillstyle(1,RED);
 bar (50,460,180,470);


 settextstyle(8,0,2);

 outtextxy(200,30,"United Arab Emirates Flag");
 return (0);
   }



  us()

  {


 rectangle(225,285,500,155);
 setfillstyle(1,BLUE);
 bar (225,225,350,155);
 setfillstyle(1, RED);
 bar (350,155,500,165);
 setfillstyle(1, WHITE);
 bar (350,165,500,175);
 setfillstyle(1,RED);
 bar (350,175,500,185);
 setfillstyle(1,WHITE);
 bar (350,185,500,195);
 setfillstyle(1,RED);
 bar (350,195,500,205);
 setfillstyle(1,WHITE);
 bar (350,205,500,215);
 setfillstyle(1,RED);
 bar (350,215,500,225);
 setfillstyle(1,WHITE);
 bar (225,225,500,235);
 setfillstyle(1,RED);
 bar (225,235,500,245);
 setfillstyle(1,WHITE);
 bar (225,245,500,255);
 setfillstyle(1,RED);
 bar (225,255,500,265);
 setfillstyle(1,WHITE);
 bar (225,265,500,275);
 setfillstyle(1,RED);
 bar (225,275,500,285);
 setcolor(WHITE);

 settextstyle(1,3,3);
 outtextxy(218,155,"*");

 settextstyle(1,3,3);
 outtextxy(230,155,"*");

 settextstyle(1,3,3);
 outtextxy(242,155,"*");

 settextstyle(1,3,3);
 outtextxy(255,155,"*");

 settextstyle(1,3,3);
 outtextxy(267,155,"*");

 settextstyle(1,3,3);
 outtextxy(279,155,"*");

 settextstyle(1,3,3);
 outtextxy(292,155,"*");

 settextstyle(1,3,3);
 outtextxy(305,155,"*");

 settextstyle(1,3,3);
 outtextxy(317,155,"*");

 settextstyle(1,3,3);
 outtextxy(330,155,"*");

 //NEW LINE
 settextstyle(1,3,3);
 outtextxy(218,170,"*");

 settextstyle(1,3,3);
 outtextxy(230,170,"*");

 settextstyle(1,3,3);
 outtextxy(242,170,"*");

 settextstyle(1,3,3);
 outtextxy(255,170,"*");

 settextstyle(1,3,3);
 outtextxy(267,170,"*");

 settextstyle(1,3,3);
 outtextxy(279,170,"*");

 settextstyle(1,3,3);
 outtextxy(292,170,"*");

 settextstyle(1,3,3);
 outtextxy(305,170,"*");

 settextstyle(1,3,3);
 outtextxy(317,170,"*");

 settextstyle(1,3,3);
 outtextxy(330,170,"*");

 //3rd LINE

 settextstyle(1,3,3);
 outtextxy(218,185,"*");

 settextstyle(1,3,3);
 outtextxy(230,185,"*");

 settextstyle(1,3,3);
 outtextxy(242,185,"*");

 settextstyle(1,3,3);
 outtextxy(255,185,"*");

 settextstyle(1,3,3);
 outtextxy(267,185,"*");

 settextstyle(1,3,3);
 outtextxy(279,185,"*");

 settextstyle(1,3,3);
 outtextxy(292,185,"*");

 settextstyle(1,3,3);
 outtextxy(305,185,"*");

 settextstyle(1,3,3);
 outtextxy(317,185,"*");

 settextstyle(1,3,3);
 outtextxy(330,185,"*");


 //4th LINE

 settextstyle(1,3,3);
 outtextxy(218,200,"*");

 settextstyle(1,3,3);
 outtextxy(230,200,"*");

 settextstyle(1,3,3);
 outtextxy(242,200,"*");

 settextstyle(1,3,3);
 outtextxy(255,200,"*");

 settextstyle(1,3,3);
 outtextxy(267,200,"*");

 settextstyle(1,3,3);
 outtextxy(279,200,"*");

 settextstyle(1,3,3);
 outtextxy(292,200,"*");

 settextstyle(1,3,3);
 outtextxy(305,200,"*");

 settextstyle(1,3,3);
 outtextxy(317,200,"*");

 settextstyle(1,3,3);
 outtextxy(330,200,"*");

  //5th LINE

 settextstyle(1,3,3);
 outtextxy(218,215,"*");

 settextstyle(1,3,3);
 outtextxy(230,215,"*");

 settextstyle(1,3,3);
 outtextxy(242,215,"*");

 settextstyle(1,3,3);
 outtextxy(255,215,"*");

 settextstyle(1,3,3);
 outtextxy(267,215,"*");

 settextstyle(1,3,3);
 outtextxy(279,215,"*");

 settextstyle(1,3,3);
 outtextxy(292,215,"*");

 settextstyle(1,3,3);
 outtextxy(305,215,"*");

 settextstyle(1,3,3);
 outtextxy(317,215,"*");

 settextstyle(1,3,3);
 outtextxy(330,215,"*");

 setfillstyle(1,RED);
 bar (220,150,225,440);
 setfillstyle(1,WHITE);
 bar (200,440,245,450);
 setfillstyle(1,RED);
 bar (190,450,260,460);
 setfillstyle(1,BLUE);
 bar (175,460,275,470);

 settextstyle(3,0,7);

 outtextxy(100,5,"U.S FLAG");

 return(0);
  }



  main()  {

char r, user;
int gd=DETECT, gm;
initgraph (&gd,&gm,"C://tc//BGI");




settextstyle(3,0,1);

printf(" \n\n a :  Pakistan\n b :  Australia\n c :  Aruba\n d :  India\n e :  Puerto\n f :  Reunion\n g :  Botswana\n h :  South Africa\n i :  UAE\n j :  US\n k :  for All Country Flags");

printf("\n\nPlease Enter Alphabet For Ur Required Country Flag From a to k:  ");


scanf("%c",&user);
cleardevice();
switch (user)
{
case 'a':

       pakistan();

       break;


case 'b':
       australia();

       break;

 case 'c':

      aruba();

      break;
 case 'd':
      india();

      break;

 case 'e':
       puerto();

       break;

 case 'f':
       reunion();

       break;

 case 'g':
       botswana();

       break;

 case 'h':
      south();

      break;

 case 'i':
      uae();

      break;

 case 'j':
      us();

      break;
 case 'k':

       pakistan();
       delay(1000);
       cleardevice();

       australia();
       delay(1000);
       cleardevice();

       aruba();
       delay(1000);
       cleardevice();

       india();
       delay(1000);
       cleardevice();

       puerto();
       delay(1000);
       cleardevice();

       reunion();
       delay(1000);
       cleardevice();

       botswana();
       delay(1000);
       cleardevice();

       south();
       delay(1000);
       cleardevice();

       uae();
       delay(1000);
       cleardevice();

       us();
       delay(1000);
       cleardevice();
       break;

 default:
     printf("You Entered Wrong Alphabet \n\nPlease Enter Correct Alphabet");
     break;
    }


settextstyle(3,0,1);

 outtextxy(350,400,"If U Want To \nRepeat Press y:    ");
 outtextxy(400,430,"If Not Than Press n:   ");
scanf("%c",&r);
r=getch();
do{
if(r=='y'){
main();
}
else{
cleardevice();
printf("Thanks For Using.....Press Any Key");
getch();
return(0);
}
}
while (r=='n');

}

No comments:

Post a Comment