Hello everyone,
I was wondering if it was possible to route some lists (using the [route] object or another one) by their first two arguments.
So for example :
[001] [1 0 1]
|
[route 001 010]
| ___ |
[1] ___ [0]
route lists by their first two arguments
Hello everyone,
I was wondering if it was possible to route some lists (using the [route] object or another one) by their first two arguments.
So for example :
[001] [1 0 1]
|
[route 001 010]
| ___ |
[1] ___ [0]
of course, you could use to route objects, first one to route according to the first number, and second one according to the second number. I was wondering if there was a more elegant way
If you have lists, then you can use [list split 2] and unpack the first two values which you can then compare with [== ]. It's not very elegant, but it does what you want.
@alexandros Thanks !
i didn't make my question quite clear using 0s and 1s
it would be more something like this
[0 1 2] [1 2 3]
|
[route 012 123]
| /
[2] [3]
How about this:
[0 1 2( [1 2 3(
| /
| /
[list split 2]
|
[unpack]
| |
[== 0] [== 1]
| |
[&& ]
|
[sel 1] <- this will bang when the first value is 0 and the second is 1
You'll need to repeat the [== 0] [== 1]
with [== 1] [== 2]
and so on, for all possible lists, or something along these lines.
@alexandros alright thanks a lot ! seems to do the work
@PLDS This will work for lists of any length, but I did not bother taking in account leading zeros, but there are a few ways to deal with that if need be.
@oid amazing, thanks
Oops! Looks like something went wrong!