W
wkaudio
Guest
Hi! Novice programmer, sorry if this is a silly question.
I have two variables, power_1 and power_2, each of which can hold a value from -1 to 3.
In this example, power_1 = 2 and power_2 = 3. Instead of having two checks, saying if power_1 = 2 && power_2 = 3, and if power_1 = 3 && power_2 = 2, is there an easy way to do one check for a 2 and a 3, in any place? I'm currently slowly working on this problem by having a very large, multi-layered switch/case tree.
The goal is, as long as there is a 2 and a 3, no matter where, we will get the same result.
Sorry if this is not a very clear question.
Thanks for your input
I have two variables, power_1 and power_2, each of which can hold a value from -1 to 3.
In this example, power_1 = 2 and power_2 = 3. Instead of having two checks, saying if power_1 = 2 && power_2 = 3, and if power_1 = 3 && power_2 = 2, is there an easy way to do one check for a 2 and a 3, in any place? I'm currently slowly working on this problem by having a very large, multi-layered switch/case tree.
The goal is, as long as there is a 2 and a 3, no matter where, we will get the same result.
Sorry if this is not a very clear question.
Thanks for your input