sicp/zapiski/lio/ackerman.scm

13 lines
230 B
Scheme
Raw Normal View History

2024-05-16 22:39:34 +02:00
(define (A x y)
(cond ((= y 0) 0)
((= x 0) (* 2 y))
((= y 1) 2)
(else (A (- x 1) (A x (- y 1))))
)
)
(define (f n) (A 0 n))
(define (g n) (A 1 n))
(define (h n) (A 2 n))
(define (k n) (A 3 n))