flip ( matrix -- newmatrix )
Factor handbook » The language » Collections » Sequence operations » Reshaping sequences

Prev:<reversed> ( seq -- reversed )


Vocabulary
sequences

Inputs
matrixa sequence of equal-length sequences


Outputs
newmatrixa sequence of equal-length sequences


Word description
Transposes the matrix; that is, rows become columns and columns become rows.

Examples
USING: prettyprint sequences ; { { 1 2 3 } { 4 5 6 } } flip .
{ { 1 4 } { 2 5 } { 3 6 } }


Definition