Skip to content

Instantly share code, notes, and snippets.

@taylorleese
Created October 5, 2010 21:19
Show Gist options
  • Save taylorleese/612368 to your computer and use it in GitHub Desktop.
Save taylorleese/612368 to your computer and use it in GitHub Desktop.
Scala - Fibonacci
def fib(n: Int): Long = n match {
case _ if n <= 1 => n
case _ => fib(n-1) + fib(n-2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment