Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (28 sloc) 0.346 kB
--[[
-- Good 'ol fashioned recursion
--]]
function fib (a, b)
print(a)
if b >= 100 then
print(b)
else
fib(b, a + b)
end
end
--[[
-- Good 'ol fashioned loop
--]]
function fibLoop()
local a = 1
local b = 1
repeat
print(a)
b = a + b
a = b - a
until b >= 100
print(a)
print(b)
end
--
fibLoop()
--fib(1, 1)
Jump to Line
Something went wrong with that request. Please try again.