// Falling_Down.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include
#include
#include
using namespace std;
enum friendship
{
ENEMY,
NEUTRAL,
WIFE,
DETECTIVE,
FRIEND,
DAUGHTER,
};
void WalkToDaughter(void);
int GetTarget(void);
void Kill(int Target);
void CheckFriendship(int Target);
void WalkToDaughter(void)
{
cout<<"Walking... n";
int tar = GetTarget();
CheckFriendship(tar);
}
int GetTarget(void)
{
return rand() % 5;
}
void Kill(int Target)
{
cout<<"Killed human. n";
}
void BeHappy(void);
void BeHappy(void)
{
cout<<"I am happy n";
}
void CheckFriendship(int Target)
{
switch (Target)
{
case 0:
Kill(Target);
WalkToDaughter();
break;
case 1:
WalkToDaughter();
break;
case 2:
WalkToDaughter();
break;
case 3:
cout << "Died! n";
break;
case 4:
WalkToDaughter();
break;
case 5:
BeHappy();
break;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
WalkToDaughter();
_getch();
return 0;
}
//
#include "stdafx.h"
#include
#include
#include
using namespace std;
enum friendship
{
ENEMY,
NEUTRAL,
WIFE,
DETECTIVE,
FRIEND,
DAUGHTER,
};
void WalkToDaughter(void);
int GetTarget(void);
void Kill(int Target);
void CheckFriendship(int Target);
void WalkToDaughter(void)
{
cout<<"Walking... n";
int tar = GetTarget();
CheckFriendship(tar);
}
int GetTarget(void)
{
return rand() % 5;
}
void Kill(int Target)
{
cout<<"Killed human. n";
}
void BeHappy(void);
void BeHappy(void)
{
cout<<"I am happy n";
}
void CheckFriendship(int Target)
{
switch (Target)
{
case 0:
Kill(Target);
WalkToDaughter();
break;
case 1:
WalkToDaughter();
break;
case 2:
WalkToDaughter();
break;
case 3:
cout << "Died! n";
break;
case 4:
WalkToDaughter();
break;
case 5:
BeHappy();
break;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
WalkToDaughter();
_getch();
return 0;
}