Pascal's triangle: Difference between revisions
m
→JS ES6: ( clearer formatting/commenting of main function )
(→JS ES6: Updated primitives) |
m (→JS ES6: ( clearer formatting/commenting of main function )) |
||
Line 2,512:
const pascal = n =>
foldl(a => {
const
return append(a, [
zipWith(
append([0], xs),
append(xs, [0])
)▼
]);
}, [
[1] // Initial seed row
], enumFromTo(1, n - 1));
// GENERIC FUNCTIONS ------------------------------------------------------
|