Starve , Stuff ?
13 04 2008“Starve a fever, Stuff a cold” goes the saying. A more popular variant seems to be, “Starve a fever, Feed a cold”.
Ruddy issue is, I always seem to get both together. Whenever I get a fever, a cold accompanies.
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.



Looks like you’ll only be starving yourself…you used an “else if” … it’ll never reach..
Yeah, good point.
@Shiva,
Oh, yes, this doesn’t apply in my case. This was when the two are mutually exclusive.
Writing a revised psuedocode
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;
damn, the onset of the cold.
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 ?
)
Ok now I have work to do
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. 
You would not have revised your first pseudocode if you felt it was up to the mark.So I was right in claiming he had a point.
@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 ?
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. 
Now you see why I skipped this post.
@Marc,
Yes, it involved a pseudocode
Why not just go to sleep? That’s the procedure I usually employ.
@George,
Yes, but I do that even when I am feeling alright. My system is somehow used to that by now and does not respond.