mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-05 08:10:05 +00:00
CPunch
0beeee0fdf
ISTRING_RESERVED was added to iStrings call & callCFunction now use memmove instead of memcpy Additionally, added cosmoO_setUserP, cosmoO_getUserP, cosmoO_setUserI and cosmoO_getUserI to the C API.
11 lines
217 B
Plaintext
11 lines
217 B
Plaintext
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 |