Algorithm for Making Friends (from Big Bang Theory)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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);