Setup

Use Language|Add Teachpack... and choose world.ss. Search in Help Desk for image.ss and for world.ss to find a list of the available functions.

Exercise 1, Eye colors

Define a function face that accepts an eye color and returns a face with that eye color.

For example, (face 'blue) could be and (face 'green) could be

Exercise 2 Bullseye

Define a function, bullseye that accepts two colors and makes a five ring bulls-eye, alternating between those two colors. Use overlay to combine circles.

Exercise 3, Beside

Write a helper function beside that takes two images and returns an image containing the two input images, one beside the other. Hint: think about the pinholes in the images -- and remember, they are not always in the center.

Use beside to build a dumbell using these two examples:

(beside 
 (circle 40 'solid 'black)
 (beside
  (rectangle 100 30 'solid 'black)
  (circle 40 'solid 'black)))
and
(beside
 (beside
  (circle 40 'solid 'black)
  (rectangle 100 30 'solid 'black))
 (circle 40 'solid 'black))

Exercise 4, Stack

Develop the function stack : image image image -> image. It overlays its input images such that the with the largest one is on the bottom, the smallest one is on top, and the middle one is in the middle.

Exercise 5, Framing

Finish the program frame-person we discussed in lecture. It takes two images as arguments and returns an image. The first input is some picture and the second input is an image inside the first. It returns a new image with the second persons image framed inside. Making test examples can be a bit tricky, so here is an example for you:

(check-expect (frame-person ) )

Exercise 6, Potential Framing

Develop the program maybe-frame-person. It accepts two pictures as in exercise 5 and if the second image is inside the first image, it frames the person as before. If the second image is not inside, it returns the original image, unmodified. In addition to the test case above, use this one:

(check-expect (maybe-frame-person ) )

Robby Findler