Skip to content

Instantly share code, notes, and snippets.

@viebel
Last active November 27, 2024 03:39
Show Gist options
  • Select an option

  • Save viebel/742298ad1e1dc55c707274aeb15de4e9 to your computer and use it in GitHub Desktop.

Select an option

Save viebel/742298ad1e1dc55c707274aeb15de4e9 to your computer and use it in GitHub Desktop.
-- defines a factorial function
function fact (n)
if n <= 0 then
return 1
else
return n * fact(n-1)
end
end
print(fact(5))
Copy link
Copy Markdown

ghost commented Nov 27, 2024

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment