Skip to content

Instantly share code, notes, and snippets.

@enigmaticape
Created November 4, 2012 19:39
Show Gist options
  • Save enigmaticape/4013259 to your computer and use it in GitHub Desktop.
Save enigmaticape/4013259 to your computer and use it in GitHub Desktop.
Ackermann's function, as given in SICP.
(define (A x y)
(cond ((= y 0) 0)
((= x 0) (* 2 y))
((= y 1) 2)
(else (A (- x 1)
(A x (- y 1))))))
@enigmaticape
Copy link
Author

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment