In this scenario I have 3x boolean vars (already set to either true
or false
)
The goal here is to identify if more than one of the set of bool vars are set to true
Right now I have the following written, which does work:
boolval := 0
if *firstbool {
boolval++
}
if *secondbool {
boolval++
}
if *thirdbool {
boolval++
}
if boolval > 1 {
// More than 1 of the bool vars are true
}
I always flag my logic if I am writing successive if{}
statements, so I figured I would ask you geniuses how you would accomplish this.