mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-26 00:50:14 +00:00
12 lines
218 B
Lua
12 lines
218 B
Lua
|
local function fib(num)
|
||
|
if num <= 1 then
|
||
|
return num
|
||
|
else
|
||
|
return fib(num-2) + fib(num-1)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
for (var i = 1; i < 40; i++) do
|
||
|
print("The fib number of " .. i .. " is " .. fib(i))
|
||
|
end
|