--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/progs/fact.scala Fri Dec 02 07:48:03 2022 +0000 @@ -0,0 +1,6 @@ +object Fact { + +def fact(n: Int): Int = + if (n == 0) 1 else n * fact(n - 1) + +}