[plt-scheme] multiply-by-pi HTDP 11.5.2

From: wooks wooks (wookiz at hotmail.com)
Date: Tue Jun 20 14:50:20 EDT 2006

http://www.htdp.org/2003-09-26/Book/curriculum-Z-H-15.html#node_sec_11.5

I can only solve this problem by using + for  the recursion. because my add 
function only works when at least one of the inputs is a natural number - 
i.e

(define (add m n)
  (cond
    [(zero? n) m]
    [else (add1 (add m (sub1 n)))]
    )
  )

which will obvious not work for the required recursion (add pi 
(multiply-by-pi (- n 1))).




Posted on the users mailing list.