mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-31 03:29:51 +02:00
matrix_transpose() generalized to transpose()
This commit is contained in:
@@ -212,4 +212,13 @@ module test_array_dim() {
|
||||
test_array_dim();
|
||||
|
||||
|
||||
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([3,4,5]) == [[3],[4],[5]]);
|
||||
}
|
||||
test_transpose();
|
||||
|
||||
|
||||
|
||||
// vim: noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
|
||||
|
Reference in New Issue
Block a user