Algorithm for Making Friends (from Big Bang Theory)
2011-03-13

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);