// LoveCalculator by prashob.ms(cyberboy)..just for fun
//Function to trim unwanted characters starts here
static string trimWord(string word)
{
char[] trimChar={'0','1','2','3','4','5','6','7','8','9','.','*',','};
word =word.Trim(trimChar);
return word;
}
private void btn1_Click(object sender, EventArgs e)
{
//Main program starts here
string one = txtFirstName.Text;
string two = txtSecondName.Text;
one = trimWord(one);
two = trimWord(two);
string firstName = one;
string secondName = two;
if (one.Length <=2)
{
MessageBox.Show("Enter Your Name Dude!");
return;
}
else if (two.Length<=2)
{
MessageBox.Show("Enter Your Lovers Name Dude!!");
return;
}
int n = 0;
int i = 0;
while (i <= one.Length - 1)
{
//Second while loop within the first starts here
while (n <= two.Length - 1)
{
if (one == two[n])
{
one = one.Remove(i, 1);
two = two.Remove(n, 1);
n = 0;
i = 0;
}
else
{
++n;
}
//Second while loop ends here
}
++i;
n = 0;
}
string comb = one + two;
int count = comb.Length;
while (count > 5)
{
count = count - 5;
}
count = count - 1;
String three = "flame";
char character = three[count];
string letter = Convert.ToString(character);
switch (letter)
{
case "f":
MessageBox.Show(firstName + "," + " " + secondName + " " + "is your friend");
break;
case "l":
MessageBox.Show(firstName + "," + " " + secondName + " " + "is your Lover");
break;
case "a":
MessageBox.Show(firstName + "," + " " + secondName + " " + "is angry with you,what happend?");
break;
case "m":
MessageBox.Show(firstName + "&" + secondName + " " + "are going to get married");
break;
case "e":
MessageBox.Show(firstName + "," + " " + secondName + " " + "is your enemy,bad luck");
break;
}
}