above-diagonal?
)coordinate-difference
)distance
)posn=?
)distance-to-origin
)swap-x-y
)scale-posn
)add-posns
)sub-posns
)choose-posn
)posn
as the model.
So use a posn
as your model!All of the problems are programming problems, and many of them depend
on one another, so it's probably a good idea to
write them all in one Definitions pane. But three (or more)
of them are animations, so I recommend commenting out the
(run-animation...)
line for all but one of the animations.
If I want to see other ones run, I can un-comment it myself.
Also turn in a log of how many errors of different kinds you encountered in the assignment, with brief comments describing each one ("mismatched parentheses" is self-explanatory, but more complex errors might need more description). Note that "errors" means not only error messages from DrScheme, but also wrong answers. You may do this using the PSP forms, or simply by keeping track in a text file or on paper and turning it in.
For every function you write, be sure to follow the design recipe. If a particular animation requires writing two or three functions, that means go through all the steps of the design recipe two or three times for that animation.
Be sure to choose meaningful names for functions and parameters, and watch for opportunities to re-use functions you (or the textbook) have already written.
This assignment is to be done in pairs, using the ideas from the "kindergarten" article. Choose a partner ASAP and schedule time to work together on the assignment. When you're finished, turn in one assignment with both names on it. You'll have a different partner for homework 6, so if you don't get along with this partner, remember it's only for a week.
Error log: /20
(I'm not grading on how many or how few errors you encountered,
only on whether you recorded them correctly.)
I sha'n't actually grade all the problems; consider the others "practice". For each function I grade, see the table below, which has columns for each step in the design recipe. You won't turn in a separate skeleton, inventory, and definition, but rather write a skeleton, then add an inventory, then add a body to turn it into a complete definition. However, if you don't get the definition working, comment it out and you'll still get partial credit for a correct skeleton and/or inventory.
Contract | Examples | Skeleton | Inventory | Definition | Choice of model and handlers (for animations) |
Working animation (for animations) |
---|---|---|---|---|---|---|
/5 | /5 | /5 | /5 | /15 | /5 | /5 |
Following directions | /10 |
Writing contracts from word problems | /10 |
Choosing examples | /10 |
Names, indentation, readability | /10 |
Coding | /10 |
Code re-use and function composition |