Sunday, September 19, 2004

C++ Codes the Moods !

As I am right now in harmony with one little programming language they call C, and it's elder bro - C++, I feel at ease to write stuff off the top of my head in coded form.

Every morning I wake up to a different mood..Dunno if it is only with me or if people out there experience the same..Anyways, the mood of the morning persists with me all through the day,
and I sometimes I feel I am in that particular mood for no reason whatsoever.

Didn't know what else to say, so I wrote out some code which will actually compile in the Turbo C++ compiler.This l'il baby could just be the code embedded in my cerebral cortex..And I've added comments for the non tech public to dig in..

// The C++ Program that decides the moods of people when they wake up every morning
#include
#include
#include
#include
#define HAPPY 0
#define PISSED 1
#define CHEERFUL 2
#define HUMANITARIAN 3
#define SERIOUS 4
#define LETS_GO_OUT_AND_KICK_SOME_ASS 5
main()
{
enum days_of_week{sunday,monday,tuesday,wednesday,thursday,friday,saturday};
int mood;
clrscr();
for(int i=sunday;i<=saturday;i++) //Seven days.. Seven Modes !
{
delay(60*60*24); //Twenty Four hours of human time..
mood=rand()%7; //Random generation of mood 0-7
switch(mood)
{
case HAPPY:
cout<<"I'm likely to be happy about something..Dunno What!?"; break;
case PISSED:cout<<"F#$@ the world! WTF am I pissed about !?"; break;
case CHEERFUL:cout<<"Let's be nice to people today.."; break;
case HUMANITARIAN:cout<<"It's not too bad to be helpful and charitable, is it?"; break;
case SERIOUS:cout<<"This day dawns with a purpose..Wonder what that could be?!"; break;
case LETS_GO_OUT_AND_KICK_SOME_ASS:cout<<"Let's go out there and kick some butt!!"; break;
default:cout<<"There is one default mood..SLOTH!!";
//Just in case there is no case!
}
}
}

0 Comments:

Post a Comment

<< Home