Pascal's triangle: Difference between revisions

m
Line 3,188:
However, multi-digit numbers take up additional space, which looks slightly odd. But we can work around that by adding additional padding and shifting the lines a bit more:
 
<syntaxhighlight lang=J> require(|."_1~ 0-3*i.@-@#) ;@((<'format/printf%6d') sprintf each -.&0)"1 !~/~i.10
1
(|."_1~ 0-3*i.@-@#) ;@((<'%6d') sprintf each -.&0)"1 !~/~i.9
1 1
1 2 1
1 23 3 1
1 34 36 4 1
1 45 10 6 10 4 5 1
1 56 1015 1020 15 5 6 1
1 67 1521 2035 1535 21 6 7 1
1 78 2128 3556 3570 2156 28 7 8 1
1 89 2836 5684 126 70 126 56 84 28 36 8 9 1
</syntaxhighlight>
 
6,962

edits