mercredi 23 septembre 2020

How to select an already created random true Boolean variable

Lets say I have four Boolean Variables,

Boolean a;
Boolean b;
Boolean c;
Boolean d;

Now before I want to select on of these variables, I run a function to find out if they are true or not (Not relevant why they are true or false, using for other aspect of project);

So lets say,

a = false;
b = true;
c = false;
d = true;

because b and d are the true variables I want to randomly select on of these two. And if three variables are true, then I would want to randomly select one from those three.

I am lost how I would be able to accomplish this.




Aucun commentaire:

Enregistrer un commentaire