Created
September 18, 2009 17:49
-
-
Save redsquirrel/189192 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SICP 1.3 | |
Fork me. Solve me. | |
==== | |
(define (square a) (* a a)) | |
(define (sum-of-squares a b) (+ (square a) (square b))) | |
(define (square-biggest-two a b c smallest) | |
(cond ((= a smallest) (sum-of-squares b c)) | |
((= b smallest) (sum-of-squares a c)) | |
((= c smallest) (sum-of-squares a b)) | |
) | |
) | |
(define (sum-sizable-squares a b c) (square-biggest-two a b c (min a b c))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment