Anonymous user
Align columns: Difference between revisions
Updated D entry
(Added F# version) |
(Updated D entry) |
||
Line 702:
=={{header|D}}==
<lang d>import std.stdio, std.string, std.algorithm, std.range, std.typetuple;
void main() {
Line 715:
int[int] maxWidths;
foreach (const line; data)
foreach (i, word; line)
maxWidths[i] = max(maxWidths.get(i, 0), word.length);
foreach (const just;
foreach (const line; data)
.map!(i => just(line[i], maxWidths[i], ' ')));
}</lang>
|