12 lines
278 B
Scheme
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))
|