Create a gist now

Instantly share code, notes, and snippets.

-- defines a factorial function
function fact (n)
if n <= 0 then
return 1
else
return n * fact(n-1)
end
end
print(fact(5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment