progs/fact.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Sat, 23 Sep 2023 23:49:44 +0100
changeset 470 86a456f8cb92
parent 449 d67c5f7177a6
permissions -rw-r--r--
updated

object Fact {

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

}