Hello, I have this function that leads to the right numbers, but the wrong order of arrays:
(~cr={|start,end|
(start..end).collect{|in|
var one,two;
one = Array.series(4,in,1);
two = Array.series(4,in,-1);
[one] ++ [two];
}
});
Now, ~cr.(1,3)
results in:
-> [ [ [ 1, 2, 3, 4 ], [ 1, 0, -1, -2 ] ], [ [ 2, 3, 4, 5 ], [ 2, 1, 0, -1 ] ], [ [ 3, 4, 5, 6 ], [ 3, 2, 1, 0 ] ] ]
How can I change the function to result in the following order, listing all three [one] first and then all three [two]:
-> [ [ [ 1, 2, 3, 4 ], [ 2, 3, 4, 5 ] ], [ [ 3, 4, 5, 6 ], [ 1, 0, -1, -2 ] ] , [ [2, 1, 0, -1 ], [ 3, 2, 1, 0 ] ] ]
Thank you for you help!