summaryrefslogtreecommitdiff
path: root/jni/ruby/benchmark/other-lang/ack.scm
blob: a80b73ba55a63f99843ff3057fcd35cc858ec8c9 (plain)
1
2
3
4
5
6
7
(define (ack m n)
  (cond ((zero? m) (+ n 1))
        ((zero? n) (ack (- m 1) 1))
        (else      (ack (- m 1) (ack m (- n 1))))))

(ack 3 9)