Skip to content

Instantly share code, notes, and snippets.

@stevencurtis
Created February 4, 2019 04:15
Show Gist options
  • Save stevencurtis/dc8dc05a828b682ba775728fc3bb8f2f to your computer and use it in GitHub Desktop.
Save stevencurtis/dc8dc05a828b682ba775728fc3bb8f2f to your computer and use it in GitHub Desktop.
An recursive implementation of the Fibonacci series
func fib (_ n: Int) -> Int {
guard n > 1 else {return n}
return fib(n - 1) + fib(n - 2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment