progs/fact.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 26 Apr 2024 17:35:36 +0100
changeset 486 9c03b5e89a2a
parent 449 d67c5f7177a6
permissions -rw-r--r--
updated

object Fact {

def fact(n: Int): Int = 
  if (n == 0) 1 else n * fact(n - 1)

}