Pascal's triangle: Difference between revisions
Content added Content deleted
(added c++) |
|||
Line 324: | Line 324: | ||
pascal = iterate nextRow [1] |
pascal = iterate nextRow [1] |
||
</pre> |
</pre> |
||
=={{header|Nial}}== |
|||
Like J |
|||
(pascal.nial) |
|||
factorial is recur [ 0 =, 1 first, pass, product, -1 +] |
|||
combination is fork [ > [first, second], 0 first, |
|||
/ [factorial second, * [factorial - [second, first], factorial first] ] |
|||
] |
|||
pascal is transpose each combination cart [pass, pass] tell |
|||
Using it |
|||
|loaddefs 'pascal.nial' |
|||
|pascal 5 |
|||
=={{header|J}}== |
=={{header|J}}== |