Skip to content

Instantly share code, notes, and snippets.

@stevencurtis
Created February 4, 2019 06:50
Show Gist options
  • Save stevencurtis/89ea4f438fb25c10052e81d9ce9f2b66 to your computer and use it in GitHub Desktop.
Save stevencurtis/89ea4f438fb25c10052e81d9ce9f2b66 to your computer and use it in GitHub Desktop.
A simple example of recursion
func countDown(_ num: Int){
if (num < 1) {return}
print (num)
return countDown(num - 1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment