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

12 lines
278 B
Scheme

(define (pascal-x-y column row)
(cond ((= column 0) 1)
((= column row) 1)
((= row 0) 1)
((> column row) 0)
(else (+ (pascal-x-y (- column 1) (- row 1)) (pascal-x-y column (- row 1)))))
)
(print (pascal-x-y 0 0))
(print (pascal-x-y 0 4))
(print (pascal-x-y 3 4))