Created
November 4, 2012 19:39
-
-
Save enigmaticape/4013259 to your computer and use it in GitHub Desktop.
Ackermann's function, as given in SICP.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (A x y) | |
(cond ((= y 0) 0) | |
((= x 0) (* 2 y)) | |
((= y 1) 2) | |
(else (A (- x 1) | |
(A x (- y 1)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ackermann's function, from discussion of solution to Exercise 1.10 of Structure and Interpretation Of Computer Programs, from the Enigmatic Ape blog at http://www.enigmaticape.com/blog/sicp-exercise-1-10-ackermanns-antics/