cwtests/cw05/fact.fun
changeset 959 64ec1884d860
parent 958 fddf099a82f8
child 960 c7009356ddd8
--- a/cwtests/cw05/fact.fun	Sat Dec 02 21:37:04 2023 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-// a simple factorial program
-// (including a tail recursive version)
-
-
-def fact(n: Int) : Int =
-  if n == 0 then 1 else n * fact(n - 1);
-
-def facT(n: Int, acc: Int) : Int =
-  if n == 0 then acc else facT(n - 1, n * acc);
-
-def facTi(n: Int) : Int = facT(n, 1);
-
-def top() : Void = {
-  print_int(fact(6));
-  print_char(',');
-  print_int(facTi(6));
-  print_char('\n')
-};
-
-top()
-