If / else if statements and with multiple true statements?

I don't know if this has been answered before but i've done a good amount of research and haven't found anything yet.

If i have a code like this:

x=0;

if (x==0){

//do this

} else if (x==0) {

//do that

}

Can i get it to pick one of those statements at random without changing the conditions of the statement?

Reason for this being i'm going to have a program write a TON of "if else" statements and i know there will might be duplicate conditions with different actions. It doesn't matter which one it picks but id like to have it vary because if it didn't there would be a lot of unused "if" statements.

Let me know what you think and sorry if im doing something wrong... still new to this. Thanks

if (x==0){

//do this

} else if (x==0) {

//do that

}

Did you mean that?

Yeah i know its going to be haha. Its mainly going to be a bunch of if else statements with x y and z coordinates. Then the values are going to be angles and distances. I already made a arduino program to write it because its way too much for me.

And i kinda expected that. I guess i can add something to the conditions but im going to have to think about that because i don't want it to be too complex.

If you want it to pick at random from a number of options, you need to generate a random number and use that in your conditions.

DrAzzy:
If you want it to pick at random from a number of options, you need to generate a random number and use that in your conditions.

The problem with that is the x y z conditions might not always be the same so if i add another random variable to the conditions it may cause it to skip over a statement that is not duplicated anywhere. There might be a way around that but i have to think about it.

Aron313:
There might be a way around that but i have to think about it.

Thought (and lots of it) is the most important ingredient for a successful computer program.

Computers are really stupid so you have to do all the thinking for them. (Seriously).

...R