Skip to content

Instantly share code, notes, and snippets.

@diakopter
Created May 30, 2012 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diakopter/2837921 to your computer and use it in GitHub Desktop.
Save diakopter/2837921 to your computer and use it in GitHub Desktop.
sub nacci (*@i) {
print "."~+@i;
my &fun := eval join '+', '*' xx @i;
@i, &fun ... *;
}
sub n-nacci ($n) { nacci (1,1, {return [+] @_} ... *)[^$n] }
say n-nacci(4)[4];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment