The Dink Network

Reply to Re: Potion puzzle [and coding in general]

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
February 11th 2018, 09:06 PM
duck.gif
toof
Peasant He/Him
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.