1;;;; -*-Mode:LISP; Package:LISP; Base:10; Syntax:ISLISP -*-
2;;;; Title:     tak.lsp
3;;;; Author:    Ikuo Takeuchi
4;;;; License:   New BSD license
5;;;; ISLISP:    Yes
6;;;; CVS:       $Id: tak.lsp,v 1.7 2013/06/18 05:21:53 jullien Exp $
7
8;;; (2) TAK -- Variant of the Takeuchi function, function-call-heavy.
9
10;;; call (tak 18 12 6)
11
12(defun tak (x y z)
13   (if (>= y x)
14       z
15       (tak (tak (- x 1) y z)
16            (tak (- y 1) z x)
17            (tak (- z 1) x y))))
18