If else problem

Hi everyone,
it is 1:00 AM in the morning and my brain is not working that well anymore.

So, I have the following code:

if(missedAttack) {
            //do nothing
        }else if(greenNumbers) {
            //do nothing
        }else {
            //DO SOMETHING!!
        }

However I want to write it in a single “if() { }” code.
I tried a bit with && and || and even with | operators, but I just can’t figure out (right now) which correct conditional combination I should use, so that it becomes a simple if case.

if (!missedAttack && !greenNumbers)
{
    // Do something
}

This seems like a warning sign that you should be sleeping instead of coding.

People who are sleep-deprived, like people who are drunk, tend to severely underestimate how impaired they are. Your efficiency will drop pretty rapidly if you do not sleep when you need to. It is possible for your efficiency to drop so low that you are actually making negative progress (when you make so many mistakes that debugging them will take longer than the original work should have taken).

Pros sleep.

1 Like