Here I am, Sunil ; Back again with a new and lot more better version of my base converter. This time the accuracy and precision is million times better than the earlier version. You can convert all sorts of numbers i.e. including real numbers ( 1.23 etc. ). Plus A Memory game to get your mind and time ticking all the time. The graphics are improved. Use of mouse makes it far more easier to use. Altogether Amazing program.

/*                     ///     BASE CONVERTER V1.1     ///
 This is a program built by Me. This was built as a
 computer science project work. The program includes an easy to use
 mathematical tool ( Base Converter ) and a memory game. The Base Converter
 is a tool which can convert all sorts of numbers (including integers and
 fractions, but excluding -ve numbers) from one base to another to very high
 degree of accuracy. The Memory game is a simple, but yet exciting game. What
 you've to do is to remember certain nos. and repeat them when asked.
*/

#include<mouse.h>                     // For Operating Mouse   // This Is Not A Standard Library Header File
#include<iostream.h>
#include<graphics.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>                     // For random()   : Generating Random Nos.
#include<string.h>
#include<stdio.h>
#include<time.h>                      // For randomize()   : Initialising Random No. Generator

// Global Variables
char rx[30];                      // Used In Conversion From Integer Or Double To Character
int snd=0;                        // Used To Toggle Sound On Or Off
int button,xax,yax;               // Used To Store Mouse Parameters

// Function Prototypes
void menu(int y=getmaxy()-25);    // Function For User Interaction At The Start

void baseconv();                  // Main Interface For Base Conversion

void num2char(int);               // Function To Convert Intergers To Character

void zoom()
{
int a,o,w,z,k;
 for(a=getmaxx()/2-75,o=getmaxy()/2,w=getmaxx()/2+75,z=getmaxy()/2,k=0;k!=60;k++,a-=5,o-=5,w+=5,z+=5)      // Zoom Effect
  {
   //setrgbpalette(WHITE,a,o,w);
   setfillstyle(1,WHITE);
   bar(a,o,w,z);
  }
  cleardevice();
}
void timer(int time)              // Timer For The Game
{
 setcolor(WHITE);
 settextstyle(1,0,1);
 outtextxy(getmaxx()/2-65,getmaxy()-55,"Time Left (SEC)");
  for(int i=time;i>0;i--)
   {
    rectangle(getmaxx()/2-50,getmaxy()-30,getmaxx()/2+50,getmaxy()-5);
    num2char(i);
    outtextxy(getmaxx()/2,getmaxy()-30,rx);
    setfillstyle(1,BLACK);
    sleep(1);
    bar(getmaxx()/2-50,getmaxy()-30,getmaxx()/2+50,getmaxy()-5);           // To Hide Text Already Printed
   }
 bar(getmaxx()/2-120,getmaxy()-60,getmaxx()/2+100,getmaxy());              // To Hide The Text Printed At Last
}



void num2char(int x)         // Converts Integer To Character Array
{
 int i=0;
  while(x!=0)
  {
   rx[i]=x%10;
   x=x/10;
   rx[i]=rx[i]+48;           // Setting Up In ASCII Format
   i++;
  }
 rx[i]='\0';
 strrev(rx);                // Reversing To Get Output In User-Understandable Form
}



void game()                 // Function For The Memory Game
{
 int k=0;
  for(int i=getmaxx();i>getmaxx()-550;i-=10,k++)              // Intro Screen
  {
   settextstyle(4,0,8);
   outtextxy(getmaxx()/2-175,getmaxy()/2-50,"Mem Rash");
   settextstyle(4,0,4);
   outtextxy(getmaxx()/2-140,getmaxy()/2+45,"By Barking Bulls !!!");
   setcolor(k);
   setrgbpalette(BLACK,random(50),random(50),random(50));
   line(getmaxx(),getmaxy()/2-45,i,getmaxy()/2-45);
   line(0,getmaxy()/2+90,getmaxx()-i,getmaxy()/2+90);
    if(i>250)
     {
      delay(75);
     }
   settextstyle(4,0,8);
  }
 setrgbpalette(BLACK,0,10,25);
 setcolor(WHITE);
 settextstyle(4,0,8);
 outtextxy(getmaxx()/2-175,getmaxy()/2-50,"Mem Rash");
 settextstyle(4,0,4);
 outtextxy(getmaxx()/2-140,getmaxy()/2+45,"By Barking Bulls !!!");
 line(getmaxx(),getmaxy()/2-45,i,getmaxy()/2-45);
 line(0,getmaxy()/2+90,getmaxx()-i,getmaxy()/2+90);
 nosound();
 sleep(1);
 int x,y;
 cleardevice();
 char opt='y';
  for(i=0;i<20;i++) // Screen Fade Effect setrgbpalette(BLACK,0,0,i); int no=0; int level=2,time=1; //Game Starts while(opt=='y') { no++; // Generating Random Nos. setcolor(WHITE); settextstyle(installuserfont("NOBL"),0,5); outtextxy(getmaxx()/2-195,25,"Here Are The Numbers"); line(0,85,getmaxx(),85); line(0,80,getmaxx(),80); line(0,10,getmaxx(),10); line(0,5,getmaxx(),5); settextstyle(2,0,5); int numb[100],tempnum[100]={0},k=0; // Variables To Store Random Nos. randomize(); int div1=0,div2=0,l=1; div2=level; if(level>10)
     {
      div1=level-10;
      div2=10;
     }
   int tempx=getmaxx()/(div2+1);
   x=tempx;y=120;
    for(i=0;i<level;i++,l++)
     {
      start:
      numb[i]=random(100);
       for(k=0;k<=i;k++)       // Checking Repeatition Of Random Nos.
	{
	 if(numb[i]==tempnum[k])
	  {
	   goto start;
	  }
	}
      tempnum[i]=numb[i];
      num2char(numb[i]);
      outtextxy(x,y,rx);                // Showing The Nos.
      delay(500);
       if(x<getmaxx()&&l<10)            // Justification Of Text
	{
	 x=x+tempx;
	}
       else
	{
	 y=y+55;
	 tempx=getmaxx()/(div1+1);
	 x=tempx;
	 l=0;
	}

     }

   timer(time);                               // Count Time
   bar(0,90,getmaxx(),getmaxy());
   bar(0,15,getmaxx(),75);
   settextstyle(installuserfont("NOBL"),0,5);
   outtextxy(getmaxx()/2-175,25,"Repeat The Numbers");
   int getnum,score=0;

   // Inputting Answer And Checking With Original Nos. Simultaneously

    for(i=0;i<level;i++) { gotoxy(38,14); cin>>getnum;
      gotoxy(38,14);
      cout<<"         ";
       for(int j=0;j<level;j++)
	{
	 if(getnum==numb[j])
	  {
	   numb[j]=-1000;
	   score++;
	  }
	}
     }
   bar(0,15,getmaxx(),75);

   // Showing Results

   settextstyle(installuserfont("NOBL"),0,5);
   outtextxy(getmaxx()/2-70,25,"Results");
   settextstyle(1,0,2);
    if(score<level) { outtextxy(getmaxx()/2-100,getmaxy()/2," You Failed !!"); outtextxy(getmaxx()/2-50,getmaxy()/2+50," Score :"); if(score==0) { outtextxy(getmaxx()/2+50,getmaxy()/2+50,"0"); } else // When User Fails { num2char(score); outtextxy(getmaxx()/2+50,getmaxy()/2+50,rx); } outtextxy(getmaxx()/2-150,getmaxy()/2+90,"Wanna Try Again ? [ Y / N ]"); opt=getche(); cleardevice(); } else // When User Succeeds { if(no>6)              // To Check Clearance Of All Levels
	{
	 cleardevice();
	 settextstyle(4,0,5);
	 outtextxy(getmaxx()/2-240,getmaxy()/2,"You Cleared All The Levels");
	 sleep(2);
	 cleardevice();
	 menu();                // Going Back To Main Menu
	}
      outtextxy(getmaxx()/2-75,getmaxy()/2,"You Made It !!");
      outtextxy(getmaxx()/2-50,getmaxy()/2+50," Score :");
      num2char(score);
      outtextxy(getmaxx()/2+50,getmaxy()/2+50,rx);
      outtextxy(getmaxx()/2-150,getmaxy()/2+90,"Wanna Go Ahead ?  [ Y / N ]");
      opt=getche();
      zoom();
      level+=2;                     // Increasing Difficulty Level
      time+=2;
      cleardevice();
     }
   }                                // End Of While Loop
 cleardevice();
 menu();                            // Going Back To Main Menu
}


long double pow(long float number,int power)         // Function For Calculating Value " Number " To The
{                                                    // Power " Power "
 long double result=1.0;                             // Including Math.h For Single Function Is Not Efficient Practice
  if(power>0)
   {
    for(int i=0;i<power;i++)
     result*=number;
   }
  else
   {
    result=number;
     for(int i=0;i<1-power;i++) result=result/number; } return(result); } void numchar(long double x) // Converting Long Value To Character Array { char re[30]; int i=1; float a=1; long long int y=x,temp; x=x-y; while(a!=0) // Converting Frational Part { x=x*10; re[i]=int(x); re[i]+=48; temp=re[i]-48; // Setting Up According To ASCII Standard if(x>1)
      x=x-temp;
    a=x-temp;
    i++;
     if(i>7)
      break;
   }
 re[0]='.';
 re[i]='\0';
 i=0;
  while(y!=0)                     // Converting Integer Part
   {
    rx[i]=y%10;
    y=y/10;
    rx[i]=rx[i]+48;
    i++;
   }
 rx[i]='\0';
 strrev(rx);
 strcat(rx,re);                  // Concatenating ( Integer + Fraction ) To Get Output In User Understandable Form
}



long double charnum(char dec[])       // Function To Convert Character To Number
{
 int j=0,k;
 long long int x=0;
 long double y=0;
 char re[30];
  for(int i=0;dec[i]!='.'&&i<strlen(dec);i++); // Counting Number Of Integer Digits k=i+1; i--; for(;i>=0;i--,j++)                                 // Converting Integer Part
   x=x+((int(dec[i])-48)*pow(10,j));
 i=0;
 j=1;
  for(;k<strlen(dec);k++,j++) y=y+((int(dec[k])-48)*pow(10,-j)); // Converting Fractional Part return x+y; } void decx(char gg[],int bs) // Function To Convert Decimal Number To Other Bases { // It Can Be Used To Convert Any Decimal Number To Any Base Upto 9 char re[30],rd[30]; // In This Program, It Has Been Used For Octal And Binary Only int i=1,temp; float a=1; long double e,x=charnum(gg); // Getting The Character Data Converted Into Computable Form long long int y=int(charnum(gg)); x=x-y; // Separating Integer Part while(a!=0) // Converting Fractional Part { x=x*bs; re[i]=int(x); re[i]+=48; // Setting Up In ASCII Format temp=re[i]-48; if(x>1)
      x=x-temp;
    a=x-temp;
    i++;
     if(i>15)
      break;
   }
 re[0]='.';
 re[i]='\0';
 i=0;
  while(y!=0)                                    // Converting Integer Part
   {
    rd[i]=y%bs;
    y=y/bs;
    rd[i]=rd[i]+48;                              // Setting up In ASCII Format
    i++;
   }
 rd[i]='\0';
 strrev(rd);
 strcat(rd,re);
 strcpy(rx,rd);
}



long double xdec(char bin[],int bs)           // To Convert Number From Other Bases To Decimal
{

//Variable Declarations

 int x[30],y[30],i,h,k,j;
 double frac=0,intg=0;

 //Storing Characters in integer form

 for(i=0;bin[i]!='\0';i++)
  {
    if(bin[i]=='.')
     break;
   y[i]=int(bin[i])-48;
  }
 h=i-1;

 //Converting Integer Part

 for(k=0;k<i;k++,h--)
  {
   intg=intg+y[k]*pow(bs,h);
  }

 //Converting Fractional Part

 i++;

 for(j=0;i<strlen(bin);i++,j++)
  {
   x[j]=int(bin[i])-48;
   frac=frac+(x[j]*pow(bs,-(j+1)));
  }
 return frac+intg;
}



int datachk(int bs,char num[])              // Function To Check Validity Of The Data Input
{
 if(bs==2)                                  // For Binary Numbers
  {
   for(int i=0;i<strlen(num);i++)
    {
     if(num[i]!='1'&&num[i]!='0'&&num[i]!='.')
      {
      bs=1;
      break;
      }
     else
      {
      bs=0;
      }
    }
  }
 else if(bs==8)   			   // For Octal Numbers
  {
   for(int i=0;i<strlen(num);i++)
    {
     if(num[i]!='1'&&num[i]!='0'&&num[i]!='2'&&num[i]!='3'&&num[i]!='4'&&num[i]!='5'&&num[i]!='6'&&num[i]!='7'&&num[i]!='.')
      {
       bs=1;
       break;
      }
     else
      {
       bs=0;
      }
    }
  }
 else if(bs==10)                            // For Decimal Numbers
  {
   for(int i=0;i<strlen(num);i++)
    {
     if(num[i]!='1'&&num[i]!='0'&&num[i]!='2'&&num[i]!='3'&&num[i]!='4'&&num[i]!='5'&&num[i]!='6'&&num[i]!='7'&&num[i]!='.'&&num[i]!='8'&&num[i]!='9')
      {
       bs=1;
       break;
      }
     else
      {
       bs=0;
      }
    }
  }
return bs;          // Returning Truth Value ( i.e. 0 If No Invalid Digits And 1 If Invaild Digits Are Encountered )
}


void tag(int x,int y=0)       // Function Displaying Various Headings Used In Program
{
 if(x==0)
  {
   settextstyle(2,0,2);
   outtextxy(getmaxx()-80,y,"BASE CONVERTER V1.1");
  }
 else if(x==1)
  {
   settextstyle(1,0,2);
   outtextxy(10,10,"BASE CONVERTER");
   line(0,12,getmaxx(),12);
   line(0,35,getmaxx(),35);
   line(0,12,0,35);
   line(getmaxx(),12,getmaxx(),35);
  }
 else if(x==2)
  {
   settextstyle(1,0,2);
   outtextxy(10,12,"HELP");
   line(0,12,getmaxx(),12);
   line(0,35,getmaxx(),35);
   line(0,12,0,35);
   line(getmaxx(),12,getmaxx(),35);
  }
}


void help()                // Function To Display Miscelaneous Facts About The Program
{
 cleardevice();
 setcolor(WHITE);
 tag(2);
 tag(0);
 int size=4;
 settextstyle(2,0,size+2);
 outtextxy(10,50,"Basic Info");
 settextstyle(2,0,size);
 outtextxy(10,70,"Program Name          Base Converter  +  Memory Game");
 outtextxy(10,80,"Program Version            1.1");
 outtextxy(10,90,"Programmer             Sunil Garwar ");
 outtextxy(10,100,"Publishing Date         24 Feb 2004    ");
 settextstyle(2,0,size+2);
 outtextxy(10,120,"Troubleshooting");
 settextstyle(2,0,size);
 outtextxy(10,140,"If You're Experiencing Problems With Program Following Might Help.");
 outtextxy(10,155,"1) If You Recieve Values Like \"1.0010+e08\" or -ve values,You're Crossing Maximum Allowed Limits.");
 outtextxy(10,165,"   This Limit Is Different, For Different Operations.So, I'm Not Mentioning The Values. ");
 outtextxy(10,175,"   If You Happen To Get In Such Trouble Try Giving Smaller Values & Get Them Added To Get Bigger Values.");
 outtextxy(10,185,"2) Don't Input -ve Value Program Has Not Been Designed To Accept -ve Values.");
 outtextxy(10,195,"   If You Wan't -ve Values To Be Converted, Convert Equivalent +ve Value & Put '-' Sign ahead it.");
 settextstyle(2,0,size+2);
 outtextxy(10,215,"About Author");
 settextstyle(2,0,size);
 outtextxy(10,235,"Occupation     Standard XI  Student");
 outtextxy(10,245,"               Delhi Public School Korba (C.G.)  India");
 outtextxy(10,255,"More Information About Us Can Be Found At  http://www.prologic.freewebsitehosting.com  ");
 settextstyle(2,0,size+2);
 outtextxy(10,275,"About Program");
 settextstyle(2,0,size);
 outtextxy(10,295,"A Simple Tool To Convert Numbers Form One Base To Another.");
 outtextxy(10,305,"You Can Check For Newer Versions At http://www.prologic.freewebsitehosting.com");
 outtextxy(10,400,"Warning : Giving Character Inputs In The Game May Corrupt The Program And Possibly Damage Your System.");
 getch();
}


void mus(int type)           // Function For Computer Beeps
{
 if(snd==0)                  // Checking Whether Sound Option Is On
  {
   if(type==1)               // Different Beeps
    {
     sound(100);
     delay(120);
     sound(80);
     delay(160);
    }
 else if(type==0)
  {
   for(int i=50;i<1000;i+=50) { sound(i); delay(10); } sound(1500); delay(300); sound(1000); delay(200); } else if(type==2) { sound(750); delay(100); } else if(type==3) { for(int i=1000;i>0;i-=50)
     {
      sound(i);
      delay(10);
     }
   sound(1000);
   delay(200);
   sound(1500);
   delay(300);
  }
 }
nosound();           // Putting Speaker Off
}



void baseconv()                   // Function Defination For User Interface Of Base Converter
{
//Variables Declaration

char opt1,opt2,opt3,data[30];
int stat=0,y=getmaxy()-25;

  for(int i=0;i<30;i++)
   data[i]=' ';
 setcolor(WHITE);
 settextstyle(2,0,4);
 outtextxy(getmaxx()/2-35,getmaxy()/2+25,"LOADING");
 rectangle(getmaxx()/2-40,getmaxy()/2+37,getmaxx()/2+10,getmaxy()/2+41);
 setfillstyle(1,RED);
  for(i=getmaxx()/2-39;i<getmaxx()/2+10;i++) { delay(10); bar(getmaxx()/2-39,getmaxy()/2+38,i,getmaxy()/2+40); } str: // Label cleardevice(); setcolor(WHITE); tag(1); tag(0); settextstyle(2,0,4); line(350,35,350,getmaxy()-25); outtextxy(35,60,"Select The Base In Which Data Is To Be Entered."); outtextxy(35,75," Decimal [ D ] "); outtextxy(35,90," Octal [ O ] "); outtextxy(35,105," Binary [ B ] "); rectangle(385,85,635,115); outtextxy(475,65,"Input Value"); input : // Label opt1=getche(); mus(2); if(opt1=='d'||opt1=='D') { rectangle(187,76,240,86); outtextxy(485,125,"Decimal"); gotoxy(50,7); cin>>data;
   stat=datachk(10,data);
    if(stat==1)
     {
      setfillstyle(1,BLACK);
      bar(482,123,600,139);
      setcolor(RED);
      outtextxy(475,125,"Invalid Data");
      mus(1);
      setcolor(WHITE);
     }
  }
 else if(opt1=='o'||opt1=='O')                  // Input Data To Be Converted
  {
   rectangle(187,90,240,101);
   outtextxy(485,125," Octal");
   gotoxy(50,7);
   cin>>data;
   stat=datachk(8,data);
   if(stat==1)
    {
     setfillstyle(1,BLACK);
     bar(482,123,600,139);
     setcolor(RED);
     outtextxy(475,125,"Invalid Data");
     mus(1);
     setcolor(WHITE);
    }
  }
 else if(opt1=='b'||opt1=='B')
  {
   rectangle(187,105,241,116);
   outtextxy(485,125,"Binary");
   gotoxy(50,7);
   cin>>data;
   stat=datachk(2,data);
    if(stat==1)
     {
      setfillstyle(1,BLACK);
      bar(482,123,600,139);
      setcolor(RED);
      outtextxy(475,125,"Invalid Data");
      mus(1);
      setcolor(WHITE);
     }
  }
 else
  {
   outtextxy(115,125,"Invalid Option");
   mus(1);
   sleep(1);
   setfillstyle(1,BLACK);
   bar(115,123,200,139);
   goto input;
  }
 if(stat==0)
  {     // Asking For Base In Which Data Is To Be Converted
   outtextxy(35,160,"Select The Base In Which Data Is To Be Converted.");
   outtextxy(35,175,"         Decimal          [   D   ]          ");
   outtextxy(35,190,"          Octal           [   O   ]          ");
   outtextxy(35,205,"         Binary           [   B   ]          ");
   rectangle(385,181,635,211);
   outtextxy(475,161,"Output Value");
   inp :                         // Label
   opt2=getche();
   mus(2);
    if(opt2=='d'||opt2=='D')               // Showing The Values
     {
      rectangle(187,175,240,186);
      outtextxy(485,221,"Decimal");
      gotoxy(50,13);
       if(opt1=='d'||opt1=='D')
	cout<<"   No Conversion Required !";
       else if(opt1=='b'||opt1=='B')
	cout<<xdec(data,2);
       else if(opt1=='o'||opt1=='O')
	cout<<xdec(data,8);
     }
    else if(opt2=='o'||opt2=='O')
     {
      rectangle(187,190,240,201);
      outtextxy(485,221," Octal");
      gotoxy(50,13);
       if(opt1=='o'||opt1=='O')
	cout<<"   No Conversion Required !";
       else if(opt1=='b'||opt1=='B')
	{
	 numchar(xdec(data,2));
	 decx(rx,8);
	 cout<<rx;
	  for(int c=0;c<30;c++)               // Clearing The Array
	   {
	    if(c==29)
	     rx[c]='\0';
	    else
	     rx[c]=' ';
	   }
	}
       else if(opt1=='d'||opt1=='d')
	{
	decx(data,8);
	cout<<rx;
	 for(int c=0;c<30;c++)               // Clearing The Array
	  {
	   if(c==29)
	   rx[c]='\0';
	   else
	   rx[c]=' ';
	  }
	}
     }
    else if(opt2=='b'||opt2=='B')
     {
      rectangle(187,205,241,216);
      outtextxy(485,221,"Binary");
      gotoxy(50,13);
      if(opt1=='b'||opt1=='B')
       cout<<"   No Conversion Required !";
      else if(opt1=='d'||opt1=='D')
       {
       decx(data,2);
       cout<<rx;
	for(int c=0;c<30;c++)               // Clearing The Array
	 {
	  if(c==29)
	  rx[c]='\0';
	  else
	  rx[c]=' ';
	 }
       }
      else if(opt1=='o'||opt1=='O')
       {
	numchar(xdec(data,8));
	decx(rx,2);
	cout<<rx;
	 for(int c=0;c<30;c++) // Clearing The Array { if(c==29) rx[c]='\0'; else rx[c]=' '; } } } else { outtextxy(115,225,"Invalid Option"); mus(1); sleep(1); setfillstyle(1,BLACK); bar(115,221,200,245); goto inp; } } rectangle(30,y,getmaxx()-30,y+15); // Menu Of Base Converter settextstyle(2,0,4); outtextxy(45,y+1,"Main Menu [ M ]"); line(175,y,175,y+15); outtextxy(190,y+1,"Continue [ C ]"); line(320,y,320,y+15); outtextxy(345,y+1,"Help [ H ]" ); line(460,y,460,y+15); outtextxy(480,y+1,"Exit [ X ]" ); mus(2); setcolor(RED); int u=1; while(u) // Loop To Get Mouse Status { lab: getmousepos(&button,&xax,&yax); if(kbhit()) { opt3=getche(); // Getting The Key Pressed break; } if(button==1&&xax>30&&xax<175&&yax>y&&yax<y+15) { rectangle(30,y,175,y+15); mus(2); setcolor(WHITE); delay(500); cleardevice(); settextstyle(1,0,1); outtextxy(getmaxx()/2-90,getmaxy()/2,"Base Converter V1.1"); tag(0); menu(); } else if(button==1&&xax>175&&xax<320&&yax>y&&yax<y+15) { rectangle(175,y,320,y+15); mus(2); setcolor(WHITE); delay(500); cleardevice(); goto str; } else if(button==1&&xax>460&&xax<getmaxx()-30&&yax>y&&yax<y+15) { rectangle(460,y,getmaxx()-30,y+15); mus(3); exit(0); } else if(button==1&&xax>320&&xax<460&&yax>y&&yax<y+15)
      {
       rectangle(320,y,460,y+15);
       mus(2);
       setcolor(WHITE);
       delay(500);
       cleardevice();
       help();
       cleardevice();
       menu();
      }
   }
  if(opt3=='m'||opt3=='M')                 // Operating The Program Using Keyboard
   {
    rectangle(30,y,175,y+15);
    setcolor(WHITE);
    mus(2);
    delay(500);
    cleardevice();
    settextstyle(1,0,1);
    outtextxy(getmaxx()/2-90,getmaxy()/2,"Base Converter V1.1");
    tag(0);
    menu();
   }
  else if(opt3=='c'||opt3=='C')
   {
    rectangle(175,y,320,y+15);
    mus(2);
    setcolor(WHITE);
    delay(500);
    cleardevice();
    goto str;
   }
  else if(opt3=='x'||opt3=='X')
   {
    rectangle(460,y,getmaxx()-30,y+15);
    mus(3);
    exit(0);
   }
  else if(opt3=='h'||opt3=='H')
   {
    rectangle(320,y,460,y+15);
    mus(2);
    setcolor(WHITE);
    delay(500);
    cleardevice();
    help();
    cleardevice();
    menu();
   }
  else
   {
    setcolor(WHITE);
    outtextxy(getmaxx()/2-30,getmaxy()-37,"Invalid Option ");
    mus(1);
    delay(500);
    setfillstyle(1,BLACK);
    bar(getmaxx()/2-30,getmaxy()-38,getmaxx()/2+50,y-1);
    goto lab;
   }
}


void menu(int y)                // Function Defination Of Main Menu
{
 str:
 settextstyle(1,0,1);
 outtextxy(getmaxx()/2-90,getmaxy()/2,"Base Converter V1.1");
 tag(0);
 char opt;
 rectangle(10,y,getmaxx()-10,y+15);
 settextstyle(2,0,4);
 outtextxy(25,y+1,"Base Converter   [  B  ]");
 line(175,y,175,y+15);
 outtextxy(190,y+1,"Game [ Memory ] [ G ]");
 line(320,y,320,y+15);
 outtextxy(335,y+1,"Sound  [  S  ]  {    }");
  if(snd==0)
   outtextxy(440,y+1,"<>");
  else
   {
    outtextxy(440,y+1,"><"); } line(475,y,475,y+15); outtextxy(490,y+1,"Help [ H ]"); line(570,y,570,y+15); outtextxy(580,y+1,"Exit [X]"); int yy=1; while(yy) // Operating Program Using Mouse { in: if(kbhit()) { opt=getche(); // Getting The Key Pressed break; } setcolor(RED); getmousepos(&button,&xax,&yax); // Getting The Mouse Status if(button==1&&xax>10&&xax<175&&yax>y&&yax<y+15) { rectangle(10,y,175,y+15); mus(2); delay(500); baseconv(); } else if(button==1&&xax>175&&xax<320&&yax>y&&yax<y+15) { rectangle(175,y,320,y+15); mus(2); delay(500); cleardevice(); game(); } else if(button==1&&xax>320&&xax<475&&yax>y&&yax<y+15) { setfillstyle(1,BLACK); mus(2); bar(440,y+1,450,y+14); setcolor(WHITE); if(snd==0) // Putting Sound Off { outtextxy(440,y+1,"><");
	  delay(300);
	  snd=1;
	 }
	else
	 {                         // Putting Sound On
	  outtextxy(440,y+1,"<>");
	  delay(300);
	  snd=0;
	 }
	 goto in;
      }
     else if(button==1&&xax>475&&xax<570&&yax>y&&yax<y+15) { rectangle(475,y,570,y+15); mus(2); delay(500); cleardevice(); help(); cleardevice(); goto str; } else if(button==1&&xax>570&&xax<getmaxx()-10&&yax>y&&yax<y+15) { rectangle(570,y,getmaxx()-10,y+15); mus(3); exit(0); } } if(opt=='b'||opt=='B') // Operating The Menu Using Keyboard { rectangle(10,y,175,y+15); mus(2); delay(500); baseconv(); } else if(opt=='g'||opt=='G') { rectangle(175,y,320,y+15); mus(2); delay(500); cleardevice(); game(); } else if(opt=='s'||opt=='S') { setfillstyle(1,BLACK); mus(2); bar(440,y+1,450,y+14); setcolor(WHITE); if(snd==0) { outtextxy(440,y+1,"><");
      delay(300);
      snd=1;
     }
    else
     {
      outtextxy(440,y+1,"<>");
      delay(300);
      snd=0;
     }
   goto in;
  }
 else if(opt=='h'||opt=='H')
  {
   rectangle(475,y,570,y+15);
   mus(2);
   delay(500);
   cleardevice();
   help();
   cleardevice();
   goto str;
  }
 else if(opt=='x'||opt=='X')
  {
   rectangle(570,y,getmaxx()-10,y+15);
   mus(3);
   exit(0);
  }
 else
  {
   setcolor(WHITE);
   outtextxy(getmaxx()/2-30,getmaxy()-37,"Invalid Option ");
   mus(1);
   delay(500);
   setfillstyle(1,BLACK);
   bar(getmaxx()/2-30,getmaxy()-38,getmaxx()/2+50,y-1);
   goto in;
  }
}

void start()                       // Function For Intro Screen On Start Up
{
 tag(0);
 settextstyle(2,0,4);
 outtextxy(getmaxx()/2-35,getmaxy()/2,"LOADING");
 rectangle(getmaxx()/2-40,getmaxy()/2+12,getmaxx()/2+10,getmaxy()/2+16);
 setfillstyle(1,RED);
  for(int i=getmaxx()/2-39;i<getmaxx()/2+10;i++)
   {
    delay(25);
    bar(getmaxx()/2-39,getmaxy()/2+13,i,getmaxy()/2+15);
   }
 delay(100);
 cleardevice();
 initmouse();
 tag(0);
  for(i=0;i<10;i++)
   {
    setrgbpalette(BLACK,0,0,i);
    delay(20);
   }
 mus(0);
 delay(100);
 zoom();
 tag(0);
 setfillstyle(1,BLACK);
 bar(0,getmaxy()/2-10,getmaxx(),getmaxy()/2+30);
 settextstyle(1,0,1);
 outtextxy(getmaxx()/2-75,getmaxy()/2,"Sunil Presents....");
 sleep(2);
 zoom();
 tag(0);
 setfillstyle(1,BLACK);
 bar(0,getmaxy()/2-10,getmaxx(),getmaxy()/2+30);
 settextstyle(1,0,1);
 outtextxy(getmaxx()/2-90,getmaxy()/2,"Base Converter V1.1");
 delay(450);
 showmouseptr();
 menu();
}

void main()
{
 int gdriver=DETECT,gmode;
 initgraph(&gdriver,&gmode,"c:\\tc\\bgi");          // Initialising Graphics Mode
 start();
 getch();
 closegraph();                                      // Closing Graphics Mode
}


//--------------------------------
//Mouse.h
//--------------------------------

#include
union REGS i,o;

initmouse()
{
i.x.ax=0;
int86(0x33,&i,&o);
return(o.x.ax);
}

showmouseptr()
{
i.x.ax=1;
int86(0x33,&i,&o);
return(0);
}

hidemouseptr()
{
i.x.ax=2;
int86(0x33,&i,&o);
return(0);
}

restrictmouseptr(int x1,int y1, int x2, int y2)
{
i.x.ax=7;
i.x.cx=x1;
i.x.dx=x2;
int86(0x33,&i,&o);

i.x.ax=8;
i.x.cx=y1;
i.x.dx=y2;
int86(0x33,&i,&o);

return(0);
}

getmousepos(int *button, int *x, int *y)
{
i.x.ax=3;
int86(0x33,&i,&o);
*button=o.x.bx;
*x=o.x.cx;
*y=o.x.dx;
return(0);
}