Catalan numbers/Pascal's triangle: Difference between revisions

Updated D entry
(Updated D entry)
Line 103:
foreach (immutable i; 1 .. N + 1) {
foreach_reverse (immutable j; 2 .. i + 1)
t[j] = t[j] += t[j - 1];
t[i + 1] = t[i];
foreach_reverse (immutable j; 2 .. i + 2)
t[j] = t[j] += t[j - 1];
write(t[i + 1] - t[i], ' ');
}