Jump to content

Pascal's triangle: Difference between revisions

Updated Dyalog APL's answer/example to format Pascal's Triangle better
(Updated Dyalog APL's answer/example to format Pascal's Triangle better)
Line 315:
== Dyalog APL ==
<lang apl>
{A←0⍕0~¨⍨(-⌽A)⌽↑,⍳⍵ ⋄ /0,¨⍉A∘.!AA←0,⍳⍵}
</lang>
 
Line 321:
 
<lang apl>
{⍕0~¨⍨(-⌽A)⌽↑,/0,¨⍉A∘.!A←0,⍳⍵}5
{A←0,⍳⍵ ⋄ ⍉A∘.!A} 3
</lang>
 
<pre>
1
1 0 0 0
1 1
1 1 0 0
1 2 1
1 2 1 0
1 3 3 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
</pre>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.