Skip to content

Instantly share code, notes, and snippets.

@dpk
Created May 28, 2012 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpk/2820282 to your computer and use it in GitHub Desktop.
Save dpk/2820282 to your computer and use it in GitHub Desktop.
Braindump No. 1: Ackermann Function
(define (ack m n)
(cond ((zero? m) (+ n 1))
((and (> m 0) (zero? n)) (ack (- m 1) 1))
((and (> m 0) (> n 0)) (ack (- m 1) (ack m (- n 1))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment