In an ideal world, this page will grow and eventually list all solutions to sicp. Suggested guidelines:
There is a wiki dedicated to SICP with solutions available in Scheme, Haskell and Oberon. Also discussions of solutions are present. http://sicp.org.ua
Some solutions I have completed
;;This program computes the cube root of a number. It also is in block structure (define (exercise-1.8 x) (define (good-enough? guess) (< (abs (- (cube guess) x)) 0.0001)) (define (cubert-iter guess) (if (good-enough? guess) guess (cubert-iter (improve guess)))) (define (improve guess) (/ (+ (/ x (* guess guess)) (* 2 guess)) 3)) (define (cube y) (* y y y)) (cubert-iter 1.0))
You might try this again after completing exercise 1.7; it has the same problems the sqrt defined in the text has.
;;http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html#%_thm_1.11 ;;Note f(n) is in recursive form (define (f n) (cond ((< n 3) n) ((>= n 3) (+ (f (- n 1)) (* 2 (f (- n 2))) (* 3 (f (- n 3))))))) ;;Testing (f 0) (f 5) (f 10)
In the same vein, I've been posting SICP solutions on my blog: http://www.kendyck.com/solutions-to-sicp/
Comments and criticism welcome.
I began posting my "readings" and exercise solutions of SICP in my blog: http://eli.thegreenplace.net/category/programming/lisp/sicp The examples and solutions are rewritten in Common Lisp instead of Scheme.
I've also begun blogging my SICP solutions in scheme and providing a little commentary. http://redlinernotes.com/blog/?cat=39
Hey guys i have also put part of my sicp solution on blogger http://www.lenatis.net .I'd like to hear from you,my email is lenatis@gmail,comments and contact are welcome!!