mirror of
https://github.com/ivabus/pantry
synced 2024-11-14 12:35:10 +03:00
12 lines
211 B
Lua
12 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))
|