Array.zip()
Array.zip(OtherArray)
Give an sequential array with one array from each array alternated.
1..5.zip(5..10)
1 |
5 |
2 |
6 |
3 |
7 |
4 |
8 |
5 |
9 |
0 |
10 |
MAGICSQUARE(3).zip(1..5)
2 | 7 | 6 |
1 | ||
9 | 5 | 1 |
2 | ||
4 | 3 | 8 |
3 | ||
0 | ||
4 | ||
0 | ||
5 |
Give an sequential array with one array from each array alternated.
1..5.zip(5..10)
1 |
5 |
2 |
6 |
3 |
7 |
4 |
8 |
5 |
9 |
0 |
10 |
MAGICSQUARE(3).zip(1..5)
2 | 7 | 6 |
1 | ||
9 | 5 | 1 |
2 | ||
4 | 3 | 8 |
3 | ||
0 | ||
4 | ||
0 | ||
5 |