Addition to every second value from the list

Hi!
I have a list of values (rotation angles) and I would like to add 180 degrees to every second item.
I tried with dispatch component. I managed to split my list to even and odd indexes and perform addition to odd set of data. Now I would like to combine this data in previous data order. Merging doesn’t keep previous order. How can I do this?

odd and even.gh (9.2 KB)

Something like this?

P.S. Just realized that your list don’t have equal lengths.

odd and even numbers.gh (9.9 KB)

Come along with an alternative solution:

P.S. changed a little bit the definition.


odd and even numbers_2.gh (14.2 KB)

1 Like

you can dispatch the Lists directly, without bothering their indexes, and then use the Weave component which does exactly the inverse of Dispatch

one note: with Dispatch, the True pattern-values push items in A, so you need to cross the streams:

odd and even_inno.gh (15.2 KB)

2 Likes

Thanks @Cumberland and @inno. Both ways work for me!