progs/fact.fun
changeset 626 2d91b2107656
parent 224 70198792c2aa
child 655 3d04ee04966d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/progs/fact.fun	Sun Jul 28 17:29:53 2019 +0100
@@ -0,0 +1,8 @@
+def fact(n) = if n == 0 then 1 else n * fact(n - 1);
+
+def facT(n, acc) = if n == 0 then acc else facT(n - 1, n * acc);
+
+facT(15, 1)
+
+//fact(15)
+