Let's say we have a following list:
{{{1}, {3}, {5}, {1, 2}, {1, 2, 3, 4, 5}}, {{1}, {3}, {5}, {3, 4}, {1,2, 3, 4, 5}}, {{1}, {3}, {5}, {1, 2, 3}, {1, 2, 3, 4,5}}, {{1}, {3}, {5}, {3, 4, 5}, {1, 2, 3, 4,5}}, {{1}, {3}, {5}, {1, 2, 3, 4}, {1, 2, 3, 4, 5}}}
.
Now, I've written this simple function:
TransformToPoints[{a_}] :=
If[First[a] == 1,
{First[a] = 0, Last[a] = Last[a] + 1},
{First[a] = First[a] - 1, Last[a] = Last[a] + 1}]
so basically that function takes in a list and transforms it to the list of 2 elements, where those 2 elements are produced as described in the function. Now, I'd like to apply this function to all the elements of lists inside the big list above (which is usually much, much bigger) so the new list would look as follows:
{{{0,2},{2,4},{4,6},{0,3},{0,6}},{{0,2},{2,4},{4,6},{2,5},{0,6}},...,{{0,2},{2,4},{4,6},{0,5},{0,6}}}
What would be the quickest way to do that?