Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Help with SICP

Name: Anonymous 2008-01-06 22:44

http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1.6
Exercise 1.3 is a bitch. I think I'm close to a solution, then I see a fundamental flaw, and have to rewrite it. My notebook paper hurts.

Name: Anonymous 2008-01-07 0:05

(define (square x) (* x x))

(define (sum-of-squares x y)
  (+ (square x) (square y)))

(define (square-largest x y z)
  (cond (or (> x y) (> x z)) (if (and (> x y) (> x z)) (define a x) (define b x))
    (or (> y x) (> y z)) (if (and (> y x) (> y z)) (define a y) (define b y))
    (else (if (and (> z x) (> z y)) (define a z) (define b z))))
  (sum-of-squares a b))


This is what I have (And know is wrong).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List