Approximate overview
Sam decided to rewrite it completely. Ran out of time. But getting close.
Sorry. The HSV colors didn’t paste. But you can re-run the code to see what happens.
> (hsv 0 100 100)
.
> (hsv 120 100 100)
.
> (hsv 240 100 100)
.
> (hsv 60 100 100)
.
> (hsv 300 100 100)
.
> (hsv 270 100 100)
.
> (hsv 330 100 100)
.
> (hsv 0 100 100)
.
> (hsv 0 50 100)
.
> (rgb->string (hsv->rgb (hsv 0 50 100)))
"255/128/128"
> (hsv 0 0 100)
.
> (rgb->string (hsv->rgb (hsv 0 0 100)))
"255/255/255"
> (hsv 0 100 100)
.
> (hsv 0 100 50)
.
> (hsv 0 100 70)
.
> (rgb->string (hsv->rgb (hsv 0 100 70)))
"178/0/0"
Please use #t for true and #f for false (no quotation marks).
(remainder dividend divisor) tells you what’s left over after you
divide dividend by divisor. So (remainder n 2) tells you how
much is left over after dividing by 2 (either 0 or 1).
What’s wrong with the following for is-even-integer?
What do you expect for each of the following?
> (number-not-integer? 3)
#f
> (number-not-integer? 3.5)
#t
> (number-not-integer? 3/4)
#t
> (number-not-integer? "three")
#f
(<= x y z) is a shorthand for (and (<= x y) (<= y z)).
y is the median.Make sure to think about the following
> (median-of-three 1 2 3)
> (median-of-three 3 2 1)
> (median-of-three 3 3 2)
> (median-of-three 2 2 3)