|
Set the Language level to Intermediate Student and add the image.ss teachpack.
You will write three functions:
![]() |
![]() |
![]() |
A conceptual overview of the implementations of these three functions will be given at the beginning of lab.
Remember: it is important now, as always, to document and test each individual function on various cases. Otherwise you cannot be sure that, as you assemble more complicated combinations of computations, your building blocks are made of good, solid stuff.
Write the two helper functions for function squeeze. The foundations of squeeze are the following operations:
round may
help you with this.
[Note: Functions mean-color and mean-pairs should be finished by the end of the lab session. To receive full credit, you should also get started on Part 2. Turn in all your work at the end of the lab session according to these submission instructions.]
[Note: To receive full credit, you should have a good start on Part 2. As usual, this part will also be part of this week's homework.]
Now write function squeeze. Then, write smash. You will need to use mean-color.
I will leave it to you to design an approach to this function; hints are
available on request.
Having written squeeze and smash, write quarter, which is merely the composition of its two predecessors.
To receive full credit, you should complete Part 1 (functions mean-color and mean-pairs) and have made a good start on Part 2. This week's homework will include Part 2 of this lab.
Save all your files and submit all your work according to the submission instructions.
Material designed by Adam Shaw.