scheme-playground/sicp-exercises/exercise1-10.scm
2024-09-26 21:29:47 +02:00

11 lines
174 B
Scheme

(define (A x y)
(cond ((= y 0) 0)
((= x 0) (* 2 y))
((= y 1) 2)
(else (A (- x 1) (A x (- y 1))))))
(print (A 0 10))
(print (A 1 10))
(print (A 2 4))
(print (A 15 1))