Cosmo/examples/fibtest.cosmo

11 lines
213 B
Plaintext
Raw Normal View History

local func fib(num)
if num <= 1 then
return num
else
return fib(num-2) + fib(num-1)
end
end
for (let i = 1; i < 40; i++) do
print("The fib number of " .. i .. " is " .. fib(i))
end