17.D

This worksheet addresses a number of challenging misconceptions. Read closely and consider you answers thoughtfully.

(define (keeper n)
  (overlay (text "Yes" n "blue")
           (rectangle 400 300 "solid" "transparent")))
(big-bang 100
  (to-draw keeper))
  1. What is the signature for the draw handler in the animation above?
  2. Describe in words briefly how to interpret the model. (How do you see changes visually.)
  3. When the animation stops, you want to change the background color to pink but the words still to be there at the same font size. How will you indicate in the model that the animation should stop?
  4. Write the “win screen draw handler”.
  5. The model is always supposed to be a number with absolute value between 5 and 250. Write a function a-ok? to use in the check-with clause of the big bang.
  6. Anastasia wants hitting a key to change to a light pink background and show “No”. Her idea is in the code below. Explain what you think about this idea.
(define (ana model key)
   (overlay (text "No" model "blue")
            (rectangle 400 300 "solid" "light pink")))
  1. Amarga wants moving the mouse to the top right corner of the screen to change the font size to 18 point. Write a check-expect for the mouse handler amarga-m.

  2. Amarga also wants moving the mouse to the middle right side of the screen to change the font size to 50 point. Write a check-expect that expresses this.

Last modified January 9, 2024: Revisions for clarity. (e821b2a)