Algorithm for Making Friends (From Big Bang Theory)


placePhoneCall();
if(!isHome())
   {
     leaveMessage();
     waitForCallBack();
   }

bool response;
if(askYesNo("Would you like to share a meal?"))
  {
    response = askYesNo("Dine Together?");
  }
 else if(askYesNo("Do you enjoy a hot beverage?"))
   {
     string beverage = getBeverage();
     switch(beverage)
       {
       case "tea": makeBeverage("tea"); break;
       case "coffee": makeBeverage("coffee"); break;
       case "cocoa": makeBeverage("cocoa"); break;
       }
   }
 else
   {
     do
       {
	 string interest = ask("Recreational activities? Tell me one of your interest.");
       }while(interest != myInterest);

     Activity a1 = new Activity(interest);
     a1.doTogether();
     partake();
   }

begin(FRIENDSHIP);


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s