Skip to content

Instantly share code, notes, and snippets.

@stevencurtis
Created February 4, 2019 10:11
Show Gist options
  • Save stevencurtis/7d9d398f8a09cf1edfe009632e724f4b to your computer and use it in GitHub Desktop.
Save stevencurtis/7d9d398f8a09cf1edfe009632e724f4b to your computer and use it in GitHub Desktop.
Factorial Recursive
func fact (_ num: Int) -> Int {
if num == 1 {return 1}
return num * fact(num - 1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment