Filter by (bool, bool)

I want to get out put from different input bools combination.
For examples, from if there are two boolean then make list like (Ture, False) then get a value or number by (bool, bool).
How do I make the nodes or write something in a block?

if the bools are (T,T) then result is 1, (T,F) = 2 (F,T), = 3, (F,F)=4 like these

Run the booleans into two if nodes, where the first is 0 if true, 1 if false. For the second, 0 if true, 2 if false.

Put four outcomes into a list, then add the outcomes from the if nodes. We know that:

TT = 0
FT = 1
TF = 2
FF = 3

So you can use this sum as an index. Feed that into a list.getitematindex node with your list of 4 options being the list.

1 Like

@jaeho You can do something like this with nested if:
image

in1 == true && in2 == true?1:
in1 == true && in2 == false?2:
in1 == false && in2 == true?3:
in1 == false && in2 == false?4:
"Check inputs";
2 Likes

Hello,
another possibility

Cordially
christian.stan