Merge commit 'ocaml3102'
[ocaml.git] / test / takc.ml
blob8e49f24849438ce16ede59ac972107d7ea1bb686
1 (***********************************************************************)
2 (* *)
3 (* Objective Caml *)
4 (* *)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
6 (* *)
7 (* Copyright 1996 Institut National de Recherche en Informatique et *)
8 (* en Automatique. All rights reserved. This file is distributed *)
9 (* under the terms of the Q Public License version 1.0. *)
10 (* *)
11 (***********************************************************************)
13 (* $Id$ *)
15 let rec tak x y z =
16 if x > y then tak (tak (x-1) y z) (tak (y-1) z x) (tak (z-1) x y)
17 else z
19 let rec repeat n =
20 if n <= 0 then 0 else tak 18 12 6 + repeat(n-1)
22 let _ = print_int (repeat 2000); print_newline(); exit 0