Skip to content

Instantly share code, notes, and snippets.

@yuuki
Created August 10, 2012 21:24
Show Gist options
  • Select an option

  • Save yuuki/3318119 to your computer and use it in GitHub Desktop.

Select an option

Save yuuki/3318119 to your computer and use it in GitHub Desktop.
def fact(n: Int) : Int = n match {
case 0 => 1
case _ => n * fact(n-1)
}
println(fact(100).toString.map(_.toInt).sum)
# 48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment