You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
239 B
15 lines
239 B
/*
|
|
*
|
|
* Original Javascript version by David Hedbor(http://www.bagley.org/~doug/shootout/)
|
|
*
|
|
*/
|
|
|
|
function fib(n)
|
|
{
|
|
if (n < 2) return 1
|
|
return fib(n-2) + fib(n-1)
|
|
}
|
|
|
|
local n = ARGS.len()!=0?ARGS[0].tointeger():1
|
|
|
|
print(fib(n)+"\n")
|