Assume I have the following booleans:
var a;
var b;
var c;
var d;
var e;
I don't care which specific ones are true, or false, just that at least 2 (or more) are true.
Would, or Can I use a bitmask (or generate one from these vars) to determine this, instead of having to run every permutation like this:
if (a or b) || (a or c) || (a or d) || (a or e) || (b or c) || (b or d) || (b or e) || (c or d) || (c or e) || (d or e)
?
(edit: correct example)
if (a and b) || (a and c) || (a and d) || (a and e) || (b and c) || (b and d) || (b and e) || (c and d) || (c and e) || (d and e)
?
Ta.