libs/sqplus/samples/fibonacci.nut

16 lines
239 B
Plaintext
Raw Permalink Normal View History

2017-01-10 04:08:49 +00:00
/*
*
* 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")