orca/ext/wasm3/test/lang/fib.lua

9 lines
130 B
Lua
Raw Permalink Normal View History

2023-04-12 14:21:03 +00:00
local function fib(n)
if n < 2 then
return n
end
return fib(n-1) + fib(n-2)
end
print(fib(tonumber(arg[1])))