public
Description: sicp exercises for the HN SICP group
Homepage:
Clone URL: git://github.com/emkay/sicp-exercises.git
sicp-exercises / chapter1 / ex1-12.ss
100644 7 lines (6 sloc) 0.129 kb
1
2
3
4
5
6
7
(define (ptriangle x y)
  (if (or (= x 0)
(= y 1)
(> y x))
1
(+ (ptriangle (- x 1) (- y 1)) (ptriangle (- x 1) y))))