Skip to content

Instantly share code, notes, and snippets.

@diegopacheco
Created March 6, 2012 04:19
Show Gist options
  • Select an option

  • Save diegopacheco/1983413 to your computer and use it in GitHub Desktop.

Select an option

Save diegopacheco/1983413 to your computer and use it in GitHub Desktop.
Scala Simple Recursion
def factorial(number:Int) : Int = if (number == 1) return 1 else number * factorial (number - 1)
println(factorial(5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment