Anonymous user
Pascal's triangle: Difference between revisions
→{{header|Perl 6}}: edit for style, remove superstitious parens
(→{{header|Perl 6}}: no need to list both niecza and rakudo; use Z instead of hyper) |
(→{{header|Perl 6}}: edit for style, remove superstitious parens) |
||
Line 1,555:
{{trans|Perl}}
<lang perl6>sub pascal ($n where $n >= 1) {
# Prints out $n rows of Pascal's triangle.
}
▲ for (1 .. $n - 1) -> $row
}</lang>▼
▲ {my @this = map (-> $a {@last[$a] + @last[$a + 1]}), 0 .. $row - 2;
▲</lang>
=== one-liner ===
|