mirror of
https://github.com/ivabus/pantry
synced 2024-11-25 18:05:07 +03:00
6285966ee7
* luajit.org * ROLLING ver * wip * maybe LUAJIT_PATH * LUA_PATH --------- Co-authored-by: Jacob Heider <jacob@tea.xyz>
11 lines
211 B
Lua
11 lines
211 B
Lua
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))
|