This homework is due at 11:59PM on Monday, September 30.
Submit them using the COMP 50 Handin button on DrRacket; the homework is the structures-ii homework.

All the exercises should be done using the Beginning Student Language.

Finger Exercises

For this homework I am recommending the same finger exercises as for the “Structures I” homework:

Problems to submit

  1. While riding in his convertible with the top down, Professor Jacob is struck in the head by an errant baseball. When he recovers, he decides to hire you to create an experiment designed to confirm the validity of Fitts’s Law, which you can look up on Wikipedia.

    Professor Jacob asks you to design a big-bang program that reacts to mouse clicks (“button-down” mouse events). In case the experimental subject decides not to click the mouse, the experimenter must also be able to limit the number of seconds for which the program runs.

    The program should draw the first mouse click as a seven-pointed, solid green star. At that point it should place a red circle at a random location on the canvas (display). The radius of the circle should be chosen randomly between 2 and 20 pixels.

    The program should then wait either for time to expire or for the experimental subject to click within the red circle.

    After the message is written, the program should return a structure containing the information relevant to an experiment on Fitts’s Law. (DrRacket will continue to display the final result on the screen.) Professor Jacob is still feeling a little foggy from the effects of the baseball, so you will have to use the Wikipedia page to figure out what information to return and how to represent it.

    Use all of the design recipes above, plus a wish list.

    Domain knowledge: The Wikipedia page talks about a “device”, a “target”, and a “movement.” The device is not under your control and you can’t measure any of its properties directly. The “target” is the red circle you create and the starting point is the star. You are able to gather data about these aspects of the problem.

    Domain knowledge: You will need the 2hdtp/image and 2htdp/universe teachpacks. In the second edition, read Section 3.6 (Designing World Programs), especially Figure 10: Signatures for interaction functions.

Karma problems

  1. Write a program that is similar to the line-drawing program we talked about in lab, except that if the program is doing the red rubber-band thing, clicking the mouse should turn the rubber band into a black line and should instantly start a new rubber band anchored at the point of the mouse click. The program should stop rubber-banding when the Esc key is pressed.

    This program will make it easy for you to draw figures with connected line segments.

  2. Run the Fitts’s Law experiment multiple times in succession and use the results to estimate the characteristics of your device.