import std.stdio;
void main() {
     auto mat = [[1, 2, 3],
                 [4, 15, 6],
                 [7, 8, 9]];
     writefln("[%([%(%2d, %)],\n %)]]", mat);
}


That outputs:

[[ 1,  2,  3],
  [ 4, 15,  6],
  [ 7,  8,  9]]

Sorry, the dlang forum online interface has added an extra leading space on only certain lines.

I use 4 spaces indents in such code.

Bye,
bearophile

Reply via email to