mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-09-01 13:03:04 +02:00
Extend the scope of transpose
It allows a transposition in respect to the secondary "diagonal"
This commit is contained in:
@@ -476,10 +476,12 @@ module test_array_dim() {
|
||||
}
|
||||
test_array_dim();
|
||||
|
||||
echo(transpose([[1,2,3],[4,5,6]],reverse=true));
|
||||
|
||||
module test_transpose() {
|
||||
assert(transpose([[1,2,3],[4,5,6],[7,8,9]]) == [[1,4,7],[2,5,8],[3,6,9]]);
|
||||
assert(transpose([[1,2,3],[4,5,6]]) == [[1,4],[2,5],[3,6]]);
|
||||
assert(transpose([[1,2,3],[4,5,6]],reverse=true) == [[6,3], [5,2], [4,1]]);
|
||||
assert(transpose([3,4,5]) == [3,4,5]);
|
||||
}
|
||||
test_transpose();
|
||||
|
Reference in New Issue
Block a user