Fibonacci numbers in Perl
Example for versions
Perl 6 (alpha),
rakudo-2010.08
Not the shortest possible implementation, but perhaps the easiest to read and understand.
sub fib { 1,1, {$^x + $^y} ... * }
fib[^16], '...' ==> join(', ') ==> say;
Comments
]]>blog comments powered by Disqus
]]>