Saturday, March 13, 2010

A C++ PROGRAM FOR FLAMES - A love GAME To Find whether your partner's relation is your Friend or Love Or Affection or Marriage Or Enemy Or Sister



include
#include
#include
#include
void main()
{
 char a[100],b[100],m='#',n='#',o='\0';
 int i=0,j=0,size,k;
 int cnt=0,cnt1=0;
 char *r,flag='y';
 clrscr();
 while(flag == 'y' || flag=='Y')
 {
 cout<<"\n\t DILLU IRUNDHA TRY PANNU MA..!!! ";
 cout<<"\n ENTER YOUR NAME  : ";
 cin>>a;

 cout<<"\n ENTER YOUR PARTNER'S NAME : ";
 cin>>b;

 size = (strlen(a)+strlen(b));

 for(i=0;a[i]!='\0';i++)
 {
  for(j=0;b[j]!='\0';j++)
  {
   if(a[i]==b[j])
   {
    size=size-2;
    break;
   }}}
 for(i=0;a[i]!='\0';i++)
 {
  for(j=i+1;a[j]!='\0';j++)
  {
   if(a[i]==a[j])
   {
    cnt = cnt+1;
    m = a[i];
   }}}
 for(i=0;b[i]!='\0';i++)
 {
  for(j=i+1;b[j]!='\0';j++)
  {
   if(b[i]==b[j])
   {
    cnt1 = cnt1+1;
    n = b[i];
   }}}
 for(i=0;b[i]!='\0';i++)
 {
  if(b[i] == m)
  {
   o=b[i];
  }}

 //cout<<"\n"<<<"\n"<<<"\n"<<
 //cout<<<<<"\n"<

 if(cnt == cnt1-1)
 {
  size = size;
 }

 else if(m!=n && cnt==0 && cnt1==1)
 {
  size = size;
 }

 else if(cnt==cnt1 && m==n)
 {
  size = size;
 }

 else if(cnt == cnt1 && m!=n && m==o)
 {
  size = size+2;
 }

 else if((cnt1 == cnt-2 || cnt == cnt1-2) && m==n && n!=o)
 {
  size = size+2;
 }

 else if(m!=n && cnt==0 && cnt1==0)
 {
  size = size;
 }

 else if(cnt == cnt-1 && m==n)
 {
  size = size;
 }

 else if(cnt%2!=0 && cnt1%2!=0 && m==n && m!=o)
 {
  size = size+2;
 }

 else if(cnt%2!=0 && cnt1%2!=0 && m!=n && cnt1!=1)
 {
  size = size+2;
 }

 else if(cnt1 == cnt-2 && m!=n && o==m)
 {
  size = size+4;
 }

 else if(m==n && cnt%2!=0 && cnt1%2!=0 && m!=o)
 {
  size = size;
 }

 else if(m==n && cnt1%2!=0 && o==m && cnt%2!=0)
 {
  size = size+9;
 }
  else if(m==n && n==o && cnt==cnt1/2)
 {
  size = size;
 }

 else
 {
  for(i=0;a[i]!='\0';i++)
  {
   for(j=1;a[j]!='\0';j++)
   {
    if(a[i]==a[j])
    {
     if(b[i] == a[i])
     {
      size = size+2;
      break;
     }}}}}

 switch(size)
 {
  case 1 :
  cout<<"\n\t ***~~~NO SPECIAL RELATION BETWEEN YOU AND YOUR PARTNER~~~***\n\t\t\t    !!! SORRY!!!";
  break;
  case 2 :
  r="E";
  break;
  case 3 :
  r="F";
  break;
  case 4 :
  r ="E";
  break;
  case 5 :
  r = "F";
  break;
  case 6 :
  r = "M";
  break;
  case 7 :
  r = "E";
  break;
  case 8 :
  r = "A";
  break;
  case 9 :
  r = "E";
  break;
  case 10 :
  r = "L";
  break;
  case 11 :
  r = "M";
  break;
  case 12 :
  r = "A";
  break;
  case 13 :
  r = "A";
  break;
  case 14 :
  r = "F";
  break;
  case 15 :
  r = "M";
  break;
  case 16 :
  r = "F";
  break;
  case 17 :
  r = "A";
  break;
  case 18 :
  r = "F";
  break;
  case 19 :
  r = "L";
  break;
  case 20 :
  r = "E";
  break;
  case 21:
  r = "F";
  break;
  case 22:
  r = "E";
  break;
  default :
  cout<<"\n\t ~~~ EVERYTHING IS BETWEEN YOU AND YOUR PARTNER ~~~ ";
  break;
 }
 cout<<"\n THE REMAINING CHARACTER IS '"<<<"' SO,";
 if(*r=='F')
 {
  cout<<"\n\n\t !!!!!!!! YOU BOTH ARE GOOD FRIENDS !!!!!!!!";
 }
 else if(*r=='L')
 {
  cout<<"\n\n\t !!!!!!@!!!!!! YOU BOTH ARE LOVERS !!!!!!@!!!!!!";
 }
 else if(*r=='M')
 {
  cout<<"\n\n\t !!!!!!!! YOU BOTH WILL MARRY EACH OTHER !!!!\b!!!!";
  cout<<"\n\n WARNING : DONT TRY TO MARRY IF YOU BOTH ARE SAME GENDER";
 }
 else if(*r=='A')
 {
  cout<<"\n\n\t ###### YOU BOTH HAVE MORE AFFECTION ON EACH OTHER ######";
 }
 else if(*r=='E')
 {
  cout<<"\n\n\t ****** YOU BOTH ARE ENEMIES ******";
 }
 else if(*r=='S')
 {
  cout<<"\n\n\t $$$$$$ SHE IS YOUR SISTER.IF THE PARTNER IS MALE THEN HE IS YOUR BROTHER $$$$$$";
 }
 /*else
 {
   cout<<"\n\n\t &&&&&& YOU ARE LIKE EVERYTHING TO HER &&&&&&";
 }*/
 cout<<"\n DO YOU WANT TO TEST AGAIN (Y/N) : ";
 flag = getch();
 clrscr();
}
}

No comments:

Post a Comment