5 (declare no-more? first-denomination except-first-denomination)
7 (defn cc [amount coin-values]
9 (or (< amount 0) (no-more? coin-values)) 0
12 (except-first-denomination coin-values))
14 (first-denomination coin-values))
17 (defn no-more? [lst] (empty? lst))
18 (defn first-denomination [lst] (first lst))
19 (defn except-first-denomination [lst] (rest lst))
22 (def *us-coins* (list 50 25 10 5 1))
23 (def *uk-coins* (list 100 50 20 10 5 2 1 0.5))
25 (deftest test-us-coins-change-for-100-cents
27 (cc 100 *us-coins*) 292
28 (cc 100 *uk-coins*) 104561))