Skip to content

Instantly share code, notes, and snippets.

@croach
Created January 2, 2010 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save croach/267631 to your computer and use it in GitHub Desktop.
Save croach/267631 to your computer and use it in GitHub Desktop.
function fib(n)
if n <= 1 then
return n
else
return fib(n-1) + fib(n-2)
end
end
for i=0, 35 do print("n = "..i.." => "..fib(i)) end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment