pantry/projects/luajit.org/test.lua

12 lines
211 B
Lua
Raw Permalink Normal View History

function fibonacci(n)
if n <= 0 then
return 0
elseif n == 1 then
return 1
else
return fibonacci(n - 1) + fibonacci(n - 2)
end
end
print("Fibonacci(10) =", fibonacci(10))