Anonymous user
Catalan numbers/Pascal's triangle: Difference between revisions
→{{header|Ruby}}: Rubyfy and simplify
(rearranges in order of the language.) |
(→{{header|Ruby}}: Rubyfy and simplify) |
||
Line 741:
<lang tcl>def catalan(num)
t = [0, 1] #grows as needed
(1.
i.downto(1){|j| t[j] += t[j-1]}
t[i+1] = t[i]
Line 749:
end
{{out}}
<pre>
</pre>
=={{header|Run BASIC}}==
|