Click here to Skip to main content
15,908,775 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am pasting here one program of CG in C....plzz help me...the menu for alphabet is working properly but menu for digits is not displayed properly...i have to submit it in college and it is very urgent...plzzz help...please mail me on "[DELETED]@yahoo.com"

C++
#include <graphics.h>
#include <math.h>
#include <conio.h>
#include <dos.h>
#include <stdlib.h>

void func_exit();
//void func_circle();
//void func_line();
//void func_pixel();
//void func_triangle();
//void func_rectangle();


void func_a();
void func_b();
void func_c();
void func_b();
void func_d();
void func_e();
void func_e();
void func_f();
void func_g();
void func_h();
void func_i();
void func_j();
void func_k();
void func_l();
void func_m();
void func_n();
void func_o();
void func_p();
void func_q();
void func_r();
void func_s();
void func_t();
void func_u();
void func_v();
void func_w();
void func_x();
void func_y();
void func_z();

void func_0();
void func_1();
void func_2();
void func_3();
void func_4();
void func_5();
void func_6();
void func_7();
void func_8();
void func_9();

void func_Square();
void func_circle();
void func_oval();
void func_polygon();
void func_hexagon();
void func_pentagon();
void func_rectangle();
void func_triangle();

enum ITEMTYPE
{
      MI_PARENT, MI_ACTION
};

struct MENUITEM
{
      enum ITEMTYPE type;
      char *name;
      char *helpstring;
      void *p;
};

struct MENU
{
      int vertical;
      char *name;
      int left;
      int top;
      int right;
      int bottom;
      int count;
      struct MENUITEM **menuitemlist;
      int curritem;
      struct MENU *parent;
};

struct MENUITEM draw_a =
{
      MI_ACTION, "A image", "A", (void*) func_a
};

struct MENUITEM draw_b =
{
      MI_ACTION, "B image", "B", (void*) func_b
};

struct MENUITEM draw_c =
{
      MI_ACTION, "C Image", "C", (void*) func_c
};

struct MENUITEM draw_d =
{
      MI_ACTION, "D Image", "D", (void*) func_d
};

struct MENUITEM draw_e =
{
      MI_ACTION, "E Image", "E", (void*) func_e
};

struct MENUITEM draw_f =
{
      MI_ACTION, "F Image", "F", (void*) func_f
};

struct MENUITEM draw_g =
{
      MI_ACTION, "G Image", "G", (void*) func_g
};

struct MENUITEM draw_h =
{
      MI_ACTION, "H Image", "H", (void*) func_h
};

struct MENUITEM draw_i =
{
      MI_ACTION, "I Image", "I", (void*) func_i
};

struct MENUITEM draw_j =
{
      MI_ACTION, "J Image", "J", (void*) func_j
};

struct MENUITEM draw_k =
{
      MI_ACTION, "K Image", "K", (void*) func_k
};

struct MENUITEM draw_l =
{
      MI_ACTION, "L Image", "L", (void*) func_l
};

struct MENUITEM draw_m =
{
      MI_ACTION, "M Image", "M", (void*) func_m
};

struct MENUITEM draw_n =
{
      MI_ACTION, "N Image", "N", (void*) func_n
};

struct MENUITEM draw_o =
{
      MI_ACTION, "O Image", "O", (void*) func_o
};

struct MENUITEM draw_p =
{
      MI_ACTION, "P Image", "P", (void*) func_p
};

struct MENUITEM draw_q =
{
      MI_ACTION, "Q Image", "Q", (void*) func_q
};

struct MENUITEM draw_r =
{
      MI_ACTION, "R Image", "R", (void*) func_r
};

struct MENUITEM draw_s =
{
      MI_ACTION, "S Image", "S", (void*) func_s
};

struct MENUITEM draw_t =
{
      MI_ACTION, "T Image", "T", (void*) func_t
};

struct MENUITEM draw_u =
{
      MI_ACTION, "U Image", "U", (void*) func_u
};

struct MENUITEM draw_v =
{
      MI_ACTION, "V Image", "V", (void*) func_v
};

struct MENUITEM draw_w =
{
      MI_ACTION, "W Image", "W", (void*) func_w
};

struct MENUITEM draw_x =
{
      MI_ACTION, "X Image", "X", (void*) func_x
};

struct MENUITEM draw_y =
{
      MI_ACTION, "Y Image", "Y", (void*) func_y
};

struct MENUITEM draw_z =
{
      MI_ACTION, "Z Image", "Z", (void*) func_z
};

struct MENUITEM *draw_list[] =
{
      &draw_a,&draw_b,&draw_c,&draw_d,&draw_e,&draw_f,&draw_g,
      &draw_h,&draw_i,&draw_j,&draw_k,&draw_l,&draw_m,&draw_n,
      &draw_o,&draw_p,&draw_q,&draw_r,&draw_s,&draw_t,&draw_u,
      &draw_v,&draw_w,&draw_x,&draw_y,&draw_z
};

struct MENUITEM draw_0 =
{
      MI_ACTION, "0 Image", "0", (void*) func_0
};

struct MENUITEM draw_1 =
{
      MI_ACTION, "1 Image", "1", (void*) func_1
};

struct MENUITEM draw_2 =
{
      MI_ACTION, "2 Image", "2", (void*) func_2
};

struct MENUITEM draw_3 =
{
      MI_ACTION, "3 Image", "3", (void*) func_3
};

struct MENUITEM draw_4 =
{
      MI_ACTION, "4 Image", "4", (void*) func_4
};

struct MENUITEM draw_5 =
{
      MI_ACTION, "5 Image", "5", (void*) func_5
};

struct MENUITEM draw_6 =
{
      MI_ACTION, "6 Image", "6", (void*) func_6
};

struct MENUITEM draw_7 =
{
      MI_ACTION, "7 Image", "7", (void*) func_7
};

struct MENUITEM draw_8 =
{
      MI_ACTION, "8 Image", "8", (void*) func_8
};

struct MENUITEM draw_9 =
{
      MI_ACTION, "9 Image", "9", (void*) func_9
};

struct MENUITEM *draw_list1[] =
{
      &draw_0,&draw_1,&draw_2,&draw_3,&draw_4,&draw_5,&draw_6,
      &draw_7,&draw_8,&draw_9
};

struct MENUITEM draw_Square =
{
      MI_ACTION, "Square Image", "Square", (void*) func_Square
};


struct MENUITEM draw_circle =
{
      MI_ACTION, "Circle Image", "Circle", (void*) func_circle
};

struct MENUITEM draw_oval =
{
      MI_ACTION, "Oval Image", "Oval", (void*) func_oval
};

struct MENUITEM draw_polygon =
{
      MI_ACTION, "Polygon Image", "Polygon", (void*) func_polygon
};
struct MENUITEM draw_hexagon =
{
      MI_ACTION, "Hexagon Image", "Hexagon", (void*) func_hexagon
};

struct MENUITEM draw_pentagon =
{
      MI_ACTION, "Pentagon Image", "Pentagon", (void*) func_pentagon
};

struct MENUITEM draw_rectangle =
{
      MI_ACTION, "Rectangle Image", "Rectangle", (void*) func_rectangle
};

struct MENUITEM draw_triangle =
{
      MI_ACTION, "Triangle Image", "Triangle", (void*) func_triangle
};


struct MENUITEM *draw_list2[] =
{
      &draw_Square,&draw_circle,&draw_oval,&draw_polygon,&draw_hexagon,
      &draw_pentagon,&draw_rectangle,&draw_triangle
};

extern struct MENU menu_root;

struct MENU menu_draw =
{
      1, "draw menu", 2, 21, 80, 335, sizeof(draw_list) / sizeof(draw_list[0]),
       draw_list, 0, &menu_root
};

struct MENUITEM root_draw =
{
      MI_PARENT, "Alphabets", "Enter to list options menu",
      (void*) &menu_draw
};

//extern struct MENU menu_root;

struct MENU menu_draw1 =
{
      1, "draw menu", 90, 21, 160, 150, sizeof(draw_list) / sizeof(draw_list[0]),
       draw_list1, 0, &menu_root
};

struct MENUITEM root_digits =
{
      MI_PARENT, "Digits", "Enter to list options menu",
       (void*) &menu_draw1
};

/*struct MENUITEM root_exit =
{
      MI_ACTION, "Exit", "Enter to exit from this application",
      (void*) func_exit
};
  */
struct MENU menu_draw2 =
{
      1, "draw menu", 2, 21, 85, 90, sizeof(draw_list) / sizeof(draw_list[0]),
       draw_list1, 0, &menu_root
};

struct MENUITEM root_shapes =
{
      MI_PARENT, "Shapes", "Enter to list options menu",
       (void*) &menu_draw2
};

struct MENUITEM root_exit =
{
      MI_ACTION, "Exit", "Enter to exit from this application",
      (void*) func_exit
};

struct MENUITEM *root_list[] =
{
      &root_draw,&root_digits,&root_shapes,&root_exit
};

struct MENU menu_root =
{
      0, "Main Menu", 2, 2, 260, 18, sizeof(root_list) / sizeof(root_list[0]), root_list, 0, NULL
};

struct WINDOW
{
      int title;
      char *name;
      int left;
      int top;
      int right;
      int bottom;
      int color;
};

struct WINDOW title_window =
{
      1, "Menu Design - 11MCA35 , 11MCA39", 0, 0, 639, 50, RED
};



/*struct WINDOW help_window = {

      0, "Help", 0, 407, 639, 425, GREEN

};*/



struct WINDOW message_window =
{
      0, "Message", 0, 415, 639, 479, GREEN
};

struct WINDOW menu_window =
{
      0, "Menu Window", 0, 55, 230, 410, DARKGRAY
};

struct WINDOW menu_window2 =
{
      0, "Menu Window", 0, 70, 200, 365, DARKGRAY
};

struct WINDOW user_window =
{
      0, "User Window", 235, 55, 639, 410, LIGHTBLUE
};

void displaywindow(struct WINDOW *wp)
{
      int w, h;
      setcolor(WHITE);
      setfillstyle(SOLID_FILL, wp-&gt;color);
      bar(wp-&gt;left, wp-&gt;top, wp-&gt;right, wp-&gt;bottom);
      rectangle(wp-&gt;left, wp-&gt;top, wp-&gt;right, wp-&gt;bottom);
      if(wp-&gt;title == 1)
      {
	    settextstyle(DEFAULT_FONT, HORIZ_DIR, 2);
	    w = wp-&gt;left + wp-&gt;right - textwidth(wp-&gt;name);
	    h = wp-&gt;top + wp-&gt;bottom - textheight(wp-&gt;name);
	    outtextxy(w / 2, h / 2, wp-&gt;name);
      }
      else
      {
	    settextstyle(DEFAULT_FONT, HORIZ_DIR, 1);
	    rectangle(wp-&gt;left, wp-&gt;top, wp-&gt;right, wp-&gt;top + 15);
	    w = wp-&gt;left + wp-&gt;right - textwidth(wp-&gt;name);
	    outtextxy(w / 2, wp-&gt;top + 2, wp-&gt;name);
      }
}

void displaymenu(struct MENU *mp)
{
// menu_window = 0, 55, 200, 365,
      int i = 0;
      int x, y;
      struct WINDOW *wp = &menu_window2;
      setfillstyle(SOLID_FILL, wp-&gt;color);
      setcolor(WHITE);
      bar(wp-&gt;left + mp-&gt;left, wp-&gt;top + mp-&gt;top, wp-&gt;left + mp-&gt;right, wp-&gt;top + mp-&gt;bottom);
      rectangle(wp-&gt;left + mp-&gt;left, wp-&gt;top + mp-&gt;top, wp-&gt;left + mp-&gt;right, wp-&gt;top + mp-&gt;bottom);
      if(mp-&gt;vertical == 1)
      {
	    x = wp-&gt;left + mp-&gt;left + 5;
	    y = wp-&gt;top + mp-&gt;top + 5;
	    for(i = 0; i &lt; mp-&gt;count; i++)
	    {
		  if(i == mp-&gt;curritem)
		  {
			setfillstyle(SOLID_FILL, WHITE);
			bar(x - 2, y - 1, x + textwidth(mp-&gt;menuitemlist[i]-&gt;name), y + textheight(mp-&gt;menuitemlist[i]-&gt;name));
			setcolor(wp-&gt;color);
			outtextxy(x, y, mp-&gt;menuitemlist[i]-&gt;name);
			y += textheight(mp-&gt;menuitemlist[i]-&gt;name);
			y += 4;
			setfillstyle(SOLID_FILL, wp-&gt;color);
			setcolor(WHITE);
//			displaywindow(&help_window);
//			outtextxy(help_window.left + 10, help_window.top + 30, mp-&gt;menuitemlist[i]-&gt;helpstring);
		  }
		  else
		  {
			outtextxy(x, y, mp-&gt;menuitemlist[i]-&gt;name);
			y += textheight(mp-&gt;menuitemlist[i]-&gt;name);
			y += 4;
		  }
	    }
      }
      else
      {
	    x = wp-&gt;left + mp-&gt;left + 5;
	    y = wp-&gt;top + mp-&gt;top + 5;
	    for(i = 0; i &lt; mp-&gt;count; i++)
	    {
		  if(i == mp-&gt;curritem)
		  {
			setfillstyle(SOLID_FILL, WHITE);
			bar(x - 2, y - 1, x + textwidth(mp-&gt;menuitemlist[i]-&gt;name), y + textheight(mp-&gt;menuitemlist[i]-&gt;name));
			setcolor(wp-&gt;color);
			outtextxy(x, y, mp-&gt;menuitemlist[i]-&gt;name);
			x += textwidth(mp-&gt;menuitemlist[i]-&gt;name);
			x += 15;
			setfillstyle(SOLID_FILL, wp-&gt;color);
			setcolor(WHITE);
		  //	displaywindow(&help_window);
		  //	outtextxy(help_window.left + 10, help_window.top + 30, mp-&gt;menuitemlist[i]-&gt;helpstring);
		  }
		  else
		  {
			outtextxy(x, y, mp-&gt;menuitemlist[i]-&gt;name);
			x += textwidth(mp-&gt;menuitemlist[i]-&gt;name);
			x += 15;
		  }
	    }
      }
}

#define LTARROW 0x4B

#define RTARROW 0x4D

#define UPARROW 0x48

#define DNARROW 0x50

#define CR 0x0d

#define ESC 0x1b

#define ALT_X 0x2d

struct MENU* handlekey(struct MENU *mp, int key)
{
      void (*fp) (void) = NULL;
      if( (key & 0x00FF) &gt; 0)
	    key = key & 0x00FF;
      else
	    key = (key & 0xFF00) &gt;&gt; 8;
	    displaywindow(&message_window);
	    switch(key)
	    {
		      case UPARROW:
	    {
	    if(mp-&gt;vertical == 1)
	    {
		mp-&gt;curritem--;
		if(mp-&gt;curritem &lt; 0)
		mp-&gt;curritem = 0;
	    }
		  break;
}
      case DNARROW:
	    {
		  if(mp-&gt;vertical == 1)
		  {
			mp-&gt;curritem++;
			if(mp-&gt;curritem &gt; mp-&gt;count - 1)
			      mp-&gt;curritem = mp-&gt;count - 1;
		  }
		  break;
	    }
      case LTARROW:
	    {
		  if(mp-&gt;vertical == 0)
		  {
			mp-&gt;curritem--;
			if(mp-&gt;curritem &lt; 0)
			      mp-&gt;curritem = 0;
		  }
		  break;
	    }
      case RTARROW:
	    {
		  if(mp-&gt;vertical == 0)
		  {
			mp-&gt;curritem++;
			if(mp-&gt;curritem &gt; mp-&gt;count - 1)
			      mp-&gt;curritem = mp-&gt;count - 1;
		  }
		  break;
	    }
      case CR:
	    {
		  struct MENUITEM *itemp = mp-&gt;menuitemlist[mp-&gt;curritem];
		  if(itemp-&gt;type == MI_PARENT)
		  {
			struct MENU *mp2 = (struct MENU*) itemp-&gt;p;
			displaymenu(mp);
			mp = mp2;
		  }
		  else if(itemp-&gt;type == MI_ACTION)
		  {
			 fp = (void (*) ()) itemp-&gt;p;
			 fp();
		  }
	    }
	    break;
      case ESC:
	    {
		  if(mp-&gt;parent != NULL)
		  {
			displaywindow(&menu_window);
			mp = mp-&gt;parent;
		  }
	    }
	    break;
      case ALT_X:
	    return NULL;
      }
      displaymenu(mp);
      return mp;
}

void func_exit()
{
      closegraph();
      exit(0);
}

void func_a()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "A" );
	settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "A for Android" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_b()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
		   outtextxy(user_window.left + 150, user_window.top + 50, "B" );
	settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "B for Blog" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_c()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "C" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "C for Cognizant" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_d()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "D" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "D for Dell" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_e()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "E" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "E for E-commerce" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_f()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "F" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "F for Facebook" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_g()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "G" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "G for Google" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_h()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "H" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "H for Hotmail" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_i()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "I" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "I for Intel" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_j()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "J" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "J for Java" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel, Radhika Panchal" );
}

void func_k()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "K" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "K for keepvid" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_l()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "L" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "L for Lic" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel, Radhika Panchal" );
}

void func_m()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "M" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "M for Mozilla" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_n()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "N" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "N for Nokia" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel, Radhika Panchal" );
}

void func_o()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "O" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "O for Orkut" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel, Radhika Panchal" );
}

void func_p()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "P" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "P for Photofunia" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel, Radhika Panchal" );
}

void func_q()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "Q" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "Q for Qatar" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel, Radhika Panchal" );
}

void func_r()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "R" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "R for Radiff" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel, Radhika Panchal" );
}

void func_s()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "S" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "S for Samsung" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_t()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "T" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "T for Twitter" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal " );
}

void func_u()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "U" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "U for Union" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_v()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "V" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "V for Vodafone" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_w()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "W" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "W for Windos" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_x()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "X" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "X for Xerox" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal " );
}

void func_y()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "Y" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "Y for Yahoo" );
	    delay(2);

      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_z()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; maxradius; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "Z" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 130, user_window.top + 250, "Z for Zapak" );
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_0()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "0" );
	    settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "Zero");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_1()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "1" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "One");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_2()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "2" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "Two");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_3()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "3" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "Three");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_4()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "4" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "Four");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_5()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "5" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "Five");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_6()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "6" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "Six");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_7()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "7" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "Seven");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_8()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "8" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "Eight");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_9()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "9" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "Nine");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_Square()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      rectangle(150,50,20,20);
/*      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "9" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "Nine");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );*/
}

void func_rectangle()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "Rectangle" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "rectangle");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_circle()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "7" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "Circle");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_oval()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "7" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "oval");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_polygon()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "7" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "Polygon");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_hexagon()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "7" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "Hexagon");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_pentagon()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "7" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "Pentagon");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}

void func_triangle()
{
     struct WINDOW *wp = &user_window;
      int i = 0;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 15);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 9; i += 3)
      {
	     settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
	     setcolor(CGA_CYAN);
      outtextxy(user_window.left + 150, user_window.top + 50, "7" );
      settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
      outtextxy(user_window.left + 160, user_window.top + 230, "triangle");
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
/*void func_line()
{
      struct WINDOW *wp = &user_window;
      int i = 0;
      int midx = (wp-&gt;left + wp-&gt;right) / 2;
      int midy = (wp-&gt;top + wp-&gt;bottom) / 2;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 18);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 360; i += 3)
      {
	    setcolor(rand() % 15);
	    line(midx,midy,midx + maxradius * cos(i * 3.1417 / 180),
	    midy - maxradius * sin(i * 3.1417 / 180) );
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Lines are drawn");
}

void func_pixel()
{
      struct WINDOW *wp = &user_window;
      int i = 0;
      int midx = (wp-&gt;left + wp-&gt;right) / 2;
      int midy = (wp-&gt;top + wp-&gt;bottom) / 2;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 18);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 2000; i ++)
      {
	    putpixel(midx + rand() % maxradius, midy + rand() % maxradius, rand() % 15);
	    putpixel(midx - rand() % maxradius, midy - rand() % maxradius, rand() % 15);
	    putpixel(midx + rand() % maxradius, midy - rand() % maxradius, rand() % 15);
	    putpixel(midx - rand() % maxradius, midy + rand() % maxradius, rand() % 15);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "B for Ball");
}

void func_triangle()
{
      struct WINDOW *wp = &user_window;
      int i = 0;
      int x1, y1, x2, y2, x3, y3;
      int midx = (wp-&gt;left + wp-&gt;right) / 2;
      int midy = (wp-&gt;top + wp-&gt;bottom) / 2;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 18);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 360; i += 3)
      {
	    setcolor(rand() % 15);
	    x1 = midx + maxradius * cos( (i+90) * 3.1417 / 180 );
	    y1 = midy - maxradius * sin( (i+90) * 3.1417 / 180 );
	    x2 = midx + maxradius * cos( (i+180) * 3.1417 / 180 );
	    y2 = midy - maxradius * sin( (i+180) * 3.1417 / 180 );
	    x3 = midx + maxradius * cos( (i+270) * 3.1417 / 180 );
	    y3 = midy - maxradius * sin( (i+270) * 3.1417 / 180 );
	    line(x1, y1, x2, y2);
	    line(x2, y2, x3, y3);
	    line(x3, y3, x1, y1);
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "C for cat");
}



void func_rectangle()
{
      struct WINDOW *wp = &user_window;
      int i = 0;
      int left, top, right, bottom;
      int midx = (wp-&gt;left + wp-&gt;right) / 2;
      int midy = (wp-&gt;top + wp-&gt;bottom) / 2;
      int maxradius = ((wp-&gt;bottom - wp-&gt;top) / 2 - 18);
      displaywindow(wp);
      randomize();
      for(i = 0; i &lt; 360; i += 3)
      {
	    setcolor(rand() % 15);
	    left = midx + maxradius * cos( (i + 90) * 3.1417 / 180);
	    top =  midy - maxradius * sin( (i + 90) * 3.1417 / 180);
	    right = midx + maxradius * cos( (i + 270) * 3.1417 / 180);
	    bottom =  midy - maxradius * sin( (i + 270) * 3.1417 / 180);
	    rectangle(left, top, right, bottom);
	    delay(2);
      }
      displaywindow(&message_window);
      outtextxy(message_window.left + 10, message_window.top + 30, "Rectangles are drawn");
}
  */
void main()
{
      int i, grd=DETECT, grm;
      struct MENU *mp = &menu_root;
      detectgraph(&grd,&grm);
      initgraph(&grd, &grm, "C:\\tc\\bgi");
      displaywindow(&title_window);
//      displaywindow(&help_window);
      displaywindow(&message_window);
      displaywindow(&menu_window);
      displaywindow(&user_window);
      displaymenu(mp);
      while(!kbhit())
      {
	      int key = bioskey(0);
	      mp = handlekey(mp, key);
	      if(mp == NULL)
	    break;
      }
      func_exit();
      getch();
}

[edit]Code block added, Email address removed - OriginalGriff[/edit]
Posted
Updated 14-Apr-12 1:02am
v3
Comments
OriginalGriff 14-Apr-12 6:50am    
1) Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know
2) That is a code dump. That is counted as very, very rude. We would have to work out what your program is supposed to do, how it is supposed to do it, and what you might consider "not displayed properly". Not going to happen.
3) It may be urgent to you, but it isn't to us. All that your stressing the urgency does is to make us think you have left it too late, and want us to do it for you. This annoys some people, and can slow a response.

Edit your question. Get rid of all the code but the bit that is showing a problem. Then tell us what the problem is. Get rid of the "it's my homework and I can't do it" bit. Then perhaps we can help.
Use the "Improve question" widget to edit your question and provide better information.
Richard MacCutchan 14-Apr-12 6:53am    
You beat me by 1 point, but I never bother with point 1 any more.
OriginalGriff 14-Apr-12 7:04am    
It's in my standard replies database, so it's only a couple of clicks for me.
If it reduces the food for spambots by a minuscule amount, it's worth it! : laugh:
akash_k_mehta 14-Apr-12 7:08am    
sorrryy sir....actually i am using this first time so sorryyy...i will take care now....

actually menu of alphabet is working properly...but menu for digits is not working properly and it is showing extra things in output window...
OriginalGriff 14-Apr-12 7:30am    
So edit your question, and only show us the relevant bits of code. And explain the problem - and example of what you expect and what you get often helps.

actually now it is showing 19 errors sir....plz help ... OriginalGriff
 
Share this answer
 
Comments
Nelek 14-Apr-12 7:07am    
with such a comment you are not going to get any help. Do you think we can do astral trips, come over your place and see your monitor?

Please be descriptive, but not "answering". You have a very nice link "improve question" to add information to the message or the "reply" or "have a question or comment" buttons to speak with someone (as I am doing now with you).

Please try to delimitate a bit the error by using debug and edit your question, leaving only the relevant code.
sorrryy sir....actually i am using this first time so sorryyy...i will take care now....

actually menu of alphabet is working properly...but menu for digits is not working properly and it is showing extra things in output window...
 
Share this answer
 
Comments
Richard MacCutchan 14-Apr-12 7:06am    
There is no point in repeating what you said in your original question. Please read the suggestions above:
Edit your question and remove all the code not connected with the problem.
Explain exactly what the problem is, in technical detail.
Show the line or lines of code where the problem occurs.

As things stand we have no idea what this code is supposed to do or where it is going wrong.
actually i dont understand why this problem is occuring...i cant paste some part where there is problem because i am not having any idea where there is a problem...sir plzzz help me...
 
Share this answer
 
Comments
Nelek 14-Apr-12 17:15pm    
Please stop adding meaningless answers. We already told you it, this is 3rd warning.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900