Skip to content

Instantly share code, notes, and snippets.

@robertpostill
Created November 6, 2010 04:27
Show Gist options
  • Save robertpostill/665192 to your computer and use it in GitHub Desktop.
Save robertpostill/665192 to your computer and use it in GitHub Desktop.
Second part of SICP exercise 1.3
(define (largest-of-the-two? x y)
(if (= (largest-of-the-two x y) x)
true
false))
(define (larger-than-thou x y z)
(if (and
(largest-of-the-two? x y)
(largest-of-the-two? x z))
x
false))
(define (largest-of-the-three a b c)
(or
(larger-than-thou a b c)
(larger-than-thou b a c)
(larger-than-thou c a b)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment