Pascal's triangle: Difference between revisions
Content added Content deleted
(→{{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: | Line 1,555: | ||
{{trans|Perl}} |
{{trans|Perl}} |
||
<lang perl6>sub pascal ($n) |
<lang perl6>sub pascal ($n where $n >= 1) { |
||
# Prints out $n rows of Pascal's triangle. |
# Prints out $n rows of Pascal's triangle. |
||
say my @last = 1; |
|||
⚫ | |||
say "1"; |
|||
⚫ | |||
$n == 1 and return 1; |
|||
say @last = 1, @this, 1; |
|||
} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
@last = (1, @this, 1); |
|||
say join(' ', @last) ;} |
|||
return 1;} |
|||
⚫ | |||
=== one-liner === |
=== one-liner === |