Rotate array in writefln?

Chris Katko ckatko at gmail.com
Wed Apr 18 06:54:29 UTC 2018


I need to rotate an array by 90 degrees, or have writefln figure 
that out.

I need, say:

0 4 5 6
0 0 0 0
0 0 0 0
0 0 0 0

But it's outputting:

0 0 0 0
4 0 0 0
5 0 0 0
6 0 0 0

int [4][4] data;
file.writeln(format("%(%-(%d %)\n%)", data));




More information about the Digitalmars-d-learn mailing list