Shifting Sublists by Varying Amounts

I am just getting into Dynamo, and am trying out the following, as a thought experiment to understand how lists work.

Lets say I have the following:

List
[0]
[0][0] Fred
[0][1] Alice
[0][2] Jennifer
[0][3] Tom
[0][4] Frank
[1]
[1][0] Fred
[1][1] Alice
[1][2] Jennifer
[1][3] Tom
[1][4] Frank
[2]
[2][0] Fred
[2][1] Alice
[2][2] Jennifer
[2][3] Tom
[2][4] Frank

And I want to shift each list an increasing amount, to end up with this:
[0] (values are shifted by 1)
[0][1] Frank
[0][2] Fred
[0][3] Alice
[0][4] Jennifer
[0][5] Tom

[1] (values are shifted by 2)
[1][1] Tom
[1][2] Frank
[1][3] Fred
[1][4] Alice
[1][5] Jennifer

[2] (values are shifted by 3)
[2][1] Jennifer
[2][2] Tom
[2][3] Frank
[2][4] Fred
[2][5] Alice

Can anyone explain to me how this can be done, on a parent list that has an arbitrary number of sublists?

Thanks!

Use List.ShiftIndices to ‘rotate’ a list. Since you’re dealing with a 2D list and are concerned with operating on the sublist’s only, combine it with List.LaceLongest and generate the desired shift amount by counting the members in the source list (i.e. your names) and generating a sequence. That will give you flexibility regardless of how many sublist’s you create:

1 Like

Setting lacing to longest should negate the need for a list combination node:

2 Likes