Anonymous user
Matrix transposition: Difference between revisions
→{{header|Erlang}}: modified the variable names to make it easier to see what is happening.
(initial addition of erlang examples) |
(→{{header|Erlang}}: modified the variable names to make it easier to see what is happening.) |
||
Line 1,077:
=={{header|Erlang}}==
A nice introduction http://langintro.com/erlang/article2/ which is much more explicit.
<lang erlang>
Line 1,089:
% Purist version
transL( [ [
[ [
transL( [
transL([ [] |
transL([]) -> [].
</lang>
{{out}}
<pre>
2> transmatrix:transL( [ [1,2,3],[4,5,6],[7,8,9] ] ).
[[1,4,7],[2,5,8],[3,6,9]]
3> transmatrix:trans( [ [1,2,3],[4,5,6],[7,8,9] ] ).
[[1,4,7],[2,5,8],[3,6,9]]
|