on-top?. It takes a point
and returns true if it is in the uppermost 50 pixels of the window.
above-diagonal?. It takes in a posn and
returns true if the point is above the diagonal. [Hint: In
Racket, the diagonal goes from the top left corner (also known as the
origin) to the bottom right corner.]within-distance?. It takes in two posns
and a number, and tells whether the posns are within that distance of one
another. (Hint: You will need to call the distance function
written in class!)
scale-posn which takes in a
number and a posn, and returns a posn formed by multiplying the number by
each of the coordinates of the input posn.
For example, (scale-posn 3 (make-posn 2 5)) "should be"
(make-posn 6 15).swap-x-y that takes in a posn and returns a new posn with the coordinates swapped: the x-coordinate of the output should be the y-coordinate of the input, and vice versa.
| Grading | Contract | Purpose | Data Analysis | Examples | Skeleton w/Inventory |
Add details to skeleton |
Definition |
| 25 points: on-top? | /2 | /1 | /3 | /3 | /2 | /2 | /12 |
| 25 points: Exercise 20.4.2 | /2 | /1 | /3 | /3 | /2 | /2 | /12 |
| 25 points: within-distance? | /2 | /1 | /3 | /3 | /2 | /2 | /12 |
| 25 points: 20.5.3 | /2 | /1 | n/a | /3 | /2 | /2 | /15 |
| Extra Credit: 20.5.2 | /2 | /1 | n/a | /3 | /2 | /2 | /15 |
Last Modified: 4/22/15