mirror of
https://github.com/ivabus/pantry
synced 2024-11-14 04:25:08 +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))
|