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

SICP Exercise 1.3

Name: Anonymous 2008-01-19 7:59

Exercise 1.3.  Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers.

(define (ex3 x y z)
                     (cond
                       ((> y z x) ((define a x) (define b y) (+ (square a) (square b))))
                       ((> y x z) ((define a x) (define b y) (+ (square a) (square b))))
                       ((> z y x) ((define a x) (define b y) (+ (square a) (square b))))
                       ((> z x y) ((define a x) (define b y) (+ (square a) (square b))))
                       ((> x z y) ((define a x) (define b y) (+ (square a) (square b))))
                       ((> x y z) ((define a x) (define b y) (+ (square a) (square b)))))


I know I'm thinking about this the wrong way. My solution doesn't work.

Name: Anonymous 2009-09-06 5:47

(͝define (͏ęx͡3̀ x҉ ͟y z)͡
̧ ̷ ҉ ̡ ͟ ̡ ̸ ͠ ́ ̸ ͟ ͠(c̡on̨d
̴ ͢ ̛ ҉ ̛ ̢ ̢ ͟ ҉ ͡ ̧ ̷ ̸ ̡ ͢ ̴ ̡(̢(̨>͞ y z͘ x̵)̢ ͜((҉de͝fi̷ǹe a ͘x)̵ (͠d̨e̕f̀in͠e ͟b̛ ̵y̴)̷ (+ (s̨qu̸are a͡)̨ (sq͝ua̕rȩ b))͝)̡)
̕ ̕ ͝ ҉ ҉ ͜ ̶ ̵ ̢ ((͜>̵ y x́ ź)҉ ͘(͝(̴def͘i͢n͞e ̀a x)͞ (defi͜n͝e͢ b y͢) ̢(+ ̨(͜śq̛u̢ar͠e ̕a͏)͝ ͘(s҉q͜u̸àre͢ ̴b))͢))
͟ ̨ ̢ ́ ̵ ̢ ͟ ͝ ͡(͡(͟>̡ z̢ y x͠) (́(́d͘efi͘ņe͘ a ͠x̴)́ (͏defi̷n͞e b ̧y̷)̨ (̨+ (͝sq͞u̸áre ̸a̧)͢ ̡(s̶q͠uar̵e̸ b̶)͞)̧)̧)
̴ ̷ ͏ ̢ ̢ ̵ ̷ ̶ ̧((> ̧z x y)̀ (҉(͝d͞ef̵in͢e ͢a x͠)͡ (d̷ef͜i͏nę ̶b͏ ̧ỳ)҉ ͟(+ ͢(̸s̡q̡uare ̨a͠) (sq̢u͞are ̵b))))̡
̢ ̷ ͝ ̶ ̸ ̨ ̸ ͠ ̀ ̸ ҉ ͘ ((͘≯ x z̸ ̸y) ̀(҉(d́efi҉ne a ̨x) ͟(͜de͘fi̶n̛e ̕b y) ̨(͡+ ͟(sq͘uar̛e̛ a)͝ ͠(̢s̵q̢ua̶re ́b͜))̷)̀)
̡ ̕ ͘ ̕ ̕ ̸ ͜ ̕ ̷ ͘ ̷ ̡ ̕ ((> x ҉y z) ((define a ̕x͝) ́(de̸fin͢e͘ b y) ̛(+͘ (̛s̀q͜u̢a͘re a̷) ̨(̛squar͏e ̕b))))̢)̵

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