#define ON 1
#define OFF 0
typedef struct
{
unsigned long WakeUp :1;
unsigned long Shower :1;
unsigned long StuffMyFace :1;
unsigned long Travel :1;
unsigned long TwiddleMyThumbs :1;
unsigned long Oogle :1;
unsigned long Pretned2Work :1;
unsigned long Hmmmmmm :1;
} ACTIONS_STRUCT;
ACTIONS_STRUCT Actions;
void main()
{
unsigned long Time;
while(1)
{
do
{
Time = get_time();
switch (Time) {
case 520:
Actions.WakeUp = ON;
Actions.Shower = ON;
execute_act();
case 600:
Actions.SuffMyFace = ON;
execute_act();
case 630:
//To Work
Actions.Travel = ON;
execute_act();
case 700:
//Arrive at Work
office_stuff(1200);
case 1200:
Actions.SuffMyFace = ON;
execute_act();
case 1300:
office_stuff(1700);
case 1700:
//Happy Happy Happy
//To House
Actions.Travel = ON;
execute_act();
case 1830:
home_stuff(2250);
default:
Actions.WakeUp = OFF;
execute_act();
}
get_day();
}while (EventParm.WeekDay == true)
//Week Ends To be coded.
//No Actions as of Yet
//Social Life to be Added
}
return;
}
void home_stuff(unsigned long StopTime)
{
unsigned long Time;
do
{
Time = get_time();
if (EventParm.JavTalkDownLoadEnd == true)
{
Actions.Hmmmmmm = ON;
//edit. Change to 'for loop'
execute_act();
execute_act();
execute_act();
execute_act();
}
if (EventParm.Hungry == true)
{
Actions.StuffMyFace = ON;
execute_act();
}
} while (Time != StopTime)
}
void office_stuff(unsigned long StopTime)
{
unsigned long Time;
do
{
Time = get_time();
//Optimize code. This if is never executed. Take it out.
if (EventParm.HotGirlisPresent == true)
{
Actions.Oogle = ON;
execute_act();
}
//This if else statement is not enough.
//Catch all Scenarios.
//i.e. if caught - KissAss = ON etc.
if (EventParm.BossIsNotLooking == true)
{
Actions.TwiddleMyThumbs = ON;
execute_act();
}
else
{
Actions.Pretend2Work = ON;
execute_act();
}
} while (Time != StopTime)
}
2 comments:
This is so... sad... and compelling.
C sucks btw.
Mike. WTF.
Post a Comment