what object sends values greater 0 to left and below 0 to the right out ?
Object needet that:
sends values greater than 0 to the left and send values below 0 to the right output
thanks,
hgh
Use a [gate] with one of the comparison objects. You will need to be careful about processing order.
For instance:
[if $i1>0 then $i1 else out2 $i1].
cool: my favorite is [if $i1>0 then $i1 else out2 $i1]
thank you very much!!! ;)
You can also try [sadam.split 0]
from the sadam Library, although that would send the values below 0 to the left outlet and above 0 to the right. Setting the @strict attribute will let you decide if you want to get the exact 0 values on the left or on the right.
Yes, [if] can be a handy shortcut. But you should be aware of the gate technique, which can be a very useful approach for a multitude of tasks.
BTW, being in a hurry, I made a silly mistake in the example I posted. Fixing it is left as an exercise to the reader. One way would be to replace the [gate 2] with a graphic gate, but extra points for solutions w/out UI objects.
@Peter
I'm always (usually) in for extra points (and interested in puzzles). It seems you forgot that the comparator (< 0) gives out 0 or 1. 0 closes the whole thing and 1 only opens the first gate.
A possible solution is adding 1 to the outcome, as such:
But, as you said, this does indeed leave a little vagueness as to the 0.
SO, how many points did I score? ;-)
The [+ 1] after the comparison was what I was after and you get full points for that!