aboutsummaryrefslogtreecommitdiff
path: root/comparison/OCaml/ack3_11.ml
diff options
context:
space:
mode:
Diffstat (limited to 'comparison/OCaml/ack3_11.ml')
-rw-r--r--comparison/OCaml/ack3_11.ml6
1 files changed, 6 insertions, 0 deletions
diff --git a/comparison/OCaml/ack3_11.ml b/comparison/OCaml/ack3_11.ml
new file mode 100644
index 0000000..6d4cdce
--- /dev/null
+++ b/comparison/OCaml/ack3_11.ml
@@ -0,0 +1,6 @@
+let rec ack m n =
+ if m==0 then n+1
+ else if n==0 then ack (m-1) 1
+ else ack (m-1) (ack m (n-1))
+
+let () = print_int (ack 3 11);