home *** CD-ROM | disk | FTP | other *** search
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; File: tak.cl
- ; Description: TAK benchmark from the Gabriel tests
- ; Author: Richard Gabriel
- ; Created: 12-Apr-85
- ; Modified: 12-Apr-85 09:58:18 (Bob Shaw)
- ; Language: Common Lisp
- ; Package: User
- ; Status: Public Domain
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- ;;; TAK -- A vanilla version of the TAKeuchi function
-
- (defun tak (x y z)
- (declare (fixnum x y z))
- (if (not (< y x))
- z
- (tak (tak (1- x) y z)
- (tak (1- y) z x)
- (tak (1- z) x y))))
-
- ;;; call: (tak 18 12 6)
-
- (run-benchmark "TAK" '(tak 18 12 6))
-