Matrix transposition: Difference between revisions

Line 1,337:
class Transpose {
function : Main(args : String[]) ~ Nil {
xinput := 4;[[1, y1, :=1, 5;1]
m := [[1, 1, 1, 1]
[2, 4, 8, 16]
[3, 9, 27, 81]
[4, 16, 64, 256]
[5, 25, 125, 625]];
dim := input->Size();
 
resultoutput := Int->New[xdim[0],ydim[1]];
for(i := 0; i < xdim[0]; i+=1;) {
for(j := 0; j < ydim[1]; j+=1;) {
resultoutput[i,j] := minput[i,j];
};
};
 
Print(result, x, youtput);
}
 
function : Print(matrix : Int[,], x : Int, y : Int) ~ Nil {
for(idim := 0matrix->Size(); i < x; i+=1;) {
for(ji := 0; ji < ydim[0]; ji+=1;) {
for(j := 0; j < dim[1]; j+=1;) {
IO.Console->Print(matrix[i,j])->Print('\t');
};
760

edits