big-bang 04
Setup:
(define (short n)
(beside (rectangle (- n 20) 10 "solid" "yellow")
(square 20 "solid" "goldenrod")))
(define initial (short 300))
(define (draw-h-4 m)
(overlay/align "right" "bottom"
m (rectangle 300 200 "solid" "lightblue")))
(big-bang initial
(on-draw draw-h-4)
(on-mouse melody))
-
What “kind of thing” is the model? (Same question, restated: what is the type of the model?)
-
What is the signature of
draw-h-4
? -
Make an accurate drawing of the first image shown.
-
What is the name and signature for the mouse handler?
-
Write a
check-expect
for the mouse handler that shows that when the old model isinitial
and you move the mouse to coordinates (30, 75), the new model isdemo1
:(define demo1 (above (short 280) (square 10 "solid" "red")))
-
Write a purpose for the mouse handler. What do you think it does?
-
Make a diagram with 3 columns showing the models in the top row (with mouse motion between them) and the result of applying the draw handler in the second row.
-
Write a check-expect for the mouse handler, showing exactly what happens when you move the mouse with the old model being
demo1
.
Last modified October 19, 2021: Site updates (7bc1cc8)