Starve , Stuff ?

“Starve a fever, Stuff a cold” goes the saying. A more popular variant seems to be, “Starve a fever, Feed a cold”.

Fever

Ruddy issue is, I always seem to get both together. Whenever I get a fever, a cold accompanies.

Cold

Now, the issue is, do I starve or do I stuff myself ? I have always been bad at decision making, but this looks like a dead end to me. To illustrate the gravity of the issue, let me write a pseudocode, (you guys can later write a program out of it) πŸ™‚

if(variable ==fever)

{

Starve;

}

else if(variable ==cold)

{

Stuff yourself;

//preferable at others’ expense πŸ˜‰

}

Predict the output of the above pseudocode.

P.S: Answers to the effect of first starve yourself and then stuff yourself will be scorned upon.

Revised Psuedocode**:

flag=0;

variable1=fever;

variable2=cold;

While(flag=0)

{

if(variable1 == fever && variable2!=cold)

{

starve;

flag=1;

}

if(variable1!=fever && variable2==cold)

{

stuff yourself;

//At shiva’s expense πŸ˜‰

flag=1;

}

}

**Rewritten on insistence from Shiva πŸ™‚

Also, the whole point of the psuedocode was pointlessness. There was no point to it to start with.

Advertisements

15 thoughts on “Starve , Stuff ?

  1. I see what your trying to do, so this is my way to not let you have your way:

    With regard to your revised code:

    Initially you only have fever as the cold is in the process, hence the condition:

    (var1==fever)&&(var2!=cold) is true

    Hence starve() executes… During this execution operation cold commences,

    hence when you leave the first ‘if’, you have both cold and fever. The second if is now obviously not executed.

    So as I said earlier you only starve; πŸ˜‰

  2. Also, I have assumed that the difference in time between the onset of fever and cold is less than the the time taken for the instruction to execute (function of number of instructions and the clock speed). Ha, so now I am right (I am right ? 😦 )

  3. Ha, ha. But in essence, even my first psuedocode was right. The variable could not have had two values and unless it was fever, else if would have executed. πŸ™‚ Some people thought there was a point to it. πŸ˜›

  4. @Srividya,

    Shiva is always right. πŸ˜€ (And, I am not being even the slightest bit sarcastic here) If you claimed he had a point, you are equally right. (all the time. no need to even think)

    I just said, people thought there was a point to the code itself. It meant other people who did not discuss it on this blog. That should clarify things ?

  5. As for the code being right or wrong, there is no point to it. It was/is meant to be pointless.

    I could come up with several arguments to prove its right and other people could come up with equally valid counter-arguments to prove me wrong.

    For instance, in an event based program, the value of the variable could even change between execution of statements. So that would mean my previous claim is wrong. (right ? πŸ™‚ ) Let’s not get into technicalities and leave it at the cold and fever. I already feel unwell again. πŸ˜‰

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s