The Dink Network

Toof's Profile

duck.gif
Toof
Peasant Male
I disagree. 
Nothing to say about me that would interest you that much... I'm serious, you have to believe me.

Private Message

2018-02-11 21:06:16
duck.gif
Toof
Peasant Male
I disagree. 
Due to the lack of real life, he was sitting in front of his computer shocked by his new discovery. The implications were huge, although, maybe not that important, or new, to the rest of humanity... and alienity.

While the awe from the recent insight was slowly wearing down, he decided to bother those duck obsessed lunatics, residing on the Dink network with it... But then, just as wireless network established connection, she suddenly came in, naked. Her breasts


Ok, enough with the 'esteemed bookwriter fantasy'...

I've accidentally discovered that 'IF' statement only checks the first true expression, and feeds the rest to the dead dragon's carcass... carcass. This isn't the question about DinkC alone, but about coding in general.

Suppose I have three booleans [boo1, boo2, boo3] with 3 possible outcomes: true/false/undefined. I know this isn't a clean boolean, but bear with me. All of 'em are independent from each other, but are generated at the same time, randomly.
What I must do, is to make sure that none of them returns true, but I must also keep the possibility of them coming out true. To avoid contradiction, if one or more comes out 'true' it's OK to tweak them to false or undefined, but I must not tweak those who turned out false/undefined.

To paint a better picture, I'll write some imaginary code:
boo1 = random(true, false, undefined);
boo2 = random(true, false, undefined);
boo3 = random(true, false, undefined);

if (boo1 == true) {
    boo1 = random(false, undefined);
    }

else if (boo2 == true) {
    boo2 = random(false, undefined);
    }

else if (boo3 ==true) {
    boo3 = random(false, undefined);
    }

else {
    //nothing else, thank you.
    }


So here is the catch. If statement will only execute as far as first condition is met. So, for an example, if boo1 and boo2 come out 'true', this code above will fix the boo1 state, but it will completely disregard boo2, and boo3.

Any ideas? And feel free to ask me for more information if you need it.

Toof has written 1 review

TitleFileTypeScoreDate
The good, the bad, and the this review The DiscipleFeaturedExceptional 9.2September 18th, 2017