3 [clojure.contrib trace test-is]))
5 ;; exercise 1.12. The following pattern of numbers is called Pascal's triangle.
11 ;; ...................
13 ;; The numbers at the edge of the triangle are all 1, and each
14 ;; number inside the triangle is the sum of the two numbers above
15 ;; it. Write a procedure that computes elements of Pascal's triangle
16 ;; by means of a recursive process.
17 (defn pascal [row col]
19 (if (or (= col 0) (= row col))
21 (+ (pascal (dec row) col)
22 (pascal (dec row) (dec col))))))