I.1 Semester I Review 1
Random shape. Drift to a new position. Reduce the amount of green.
- Random shape. Write a function that returns a square, circle, or triangle. All should be equally likely.
random-shape: ignore -> image
- 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)
- Reduce green. Write a function
less-green
that reduces the amount of green in a color by 25%.
less-green: color -> color