How to check for two conditions and output according to state of either?

Jan 13, 2013 at 10:52pm

How to check for two conditions and output according to state of either?

I need something like this:
a + a = a
b + b = b
a + b = c
b + a = c

So the position doesn’t matter. I’m kinda lost

edit: I am aware of [if] and multiple conditions, but you need to specify for each input, i want it input-independent. just checks both and outputs if the combination is right.

I’d use “+” but I’m using Symbols. The stupidest way would be a dictionary in coll and an object that converts symbols to numbers.

#66054
Jan 13, 2013 at 11:07pm

for symbols both, the comparison operators and [if], are out of question.
you can compare (here: check for equality) symbols using [zl union] and [zl sect] relatively easy.

to “add” 2 conditions you would just add the 2 results (0 or 1 for each comparison) and
check for 0 or non 0.

example:

[> ] [> ]
|      |
[if ($i1+$i2) then 1 else 0]

#237815
Jan 13, 2013 at 11:43pm

how bout this?

– Pasted Max Patch, click to expand. –
#237816
Jan 14, 2013 at 12:16am

unfortunately this isn’t any more simple than my solution.
I might as well be specific and post a patcher, I’ll open a new topic because the patcher has other problems as well

#237817

You must be logged in to reply to this topic.