[ create a new paste ] login | about

Project: programmingpraxis
Link: http://programmingpraxis.codepad.org/lLpK9rFw    [ raw code | output | fork ]

programmingpraxis - Scheme, pasted on May 22:
1
2
3
4
5
6
7
8
; ackermann's function

(define (a m n)
  (cond ((zero? m) (+ n 1))
        ((zero? n) (a (- m 1) 1))
        (else (a (- m 1) (a m (- n 1))))))

(display (a 3 4))


Output:
1
125


Create a new paste based on this one


Comments: