I.1 Semester I Review 1

  1. Random shape. Write a function that returns a square, circle, or triangle. All should be equally likely.

    random-shape: ignore -> image
  2. Drift. A smiley face starts at some position on the screen. It randomly drifts 5 pixels in some direction (up, down, left, or right) every 0.2 seconds. Write the function that gives its new position.

    drift-to-new: posn(old) -> posn(new)
  3. Reduce green. Write a function less-green that reduces the amount of green in a color by 25%.

    less-green: color -> color