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