summaryrefslogtreecommitdiffstats
path: root/one/three.scm
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2017-01-14 21:44:28 +0000
committerrsiddharth <s@ricketyspace.net>2017-01-14 21:44:28 +0000
commit19ed602c1ba7dc2b933274f50085c9c4f0f1105c (patch)
tree5f4ddb70cb61cf509d6a74bbfa4ccde0c9227fc5 /one/three.scm
parent8d6bb0aee4679f874ddfb6f7edd8945852cb9c99 (diff)
one -> net/ricketyspace/sicp
Diffstat (limited to 'one/three.scm')
-rw-r--r--one/three.scm36
1 files changed, 0 insertions, 36 deletions
diff --git a/one/three.scm b/one/three.scm
deleted file mode 100644
index 8b4c622..0000000
--- a/one/three.scm
+++ /dev/null
@@ -1,36 +0,0 @@
-;;; Under Creative Commons Attribution-ShareAlike 4.0
-;;; International. See
-;;; <https://creativecommons.org/licenses/by-sa/4.0/>.
-
-(define-module (one three)
- #:export (square sum-of-squares largest first-arg-2nd-largest-p
- sum-of-squares-of-largest-two))
-
-(define (square x) (* x x))
-
-(define (sum-of-squares x y)
- (+ (square x) (square y)))
-
-(define (largest x y z)
- (cond ((and (>= x y)
- (>= x z)) x)
- ((and (>= y x)
- (>= y z)) y)
- ((and (>= z x)
- (>= z y)) z)))
-
-(define (first-arg-2nd-largest-p x y z)
- (or (and (>= x y)
- (<= x z))
- (and (<= x y)
- (>= x z))
- ))
-
-(define (sum-of-squares-of-largest-two x y z)
- (sum-of-squares (largest x y z)
- (cond ((first-arg-2nd-largest-p x y z)
- x)
- ((first-arg-2nd-largest-p y x z)
- y)
- ((first-arg-2nd-largest-p z x y)
- z))))