Created
February 4, 2019 06:50
-
-
Save stevencurtis/89ea4f438fb25c10052e81d9ce9f2b66 to your computer and use it in GitHub Desktop.
A simple example of recursion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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