15. Warmups A
-
Write a function
pick-pic : Number -> Image
that uses a number 1, 2, or 3 to select a picture of a water balloon, a deck of cards, or a car. -
Modify your function so that putting any other number produces a picture of a mouse.
-
Write a function
cshape: String -> Image
that uses words “triangle”, “rectangle”, and “circle” to select a picture of a red triangle, a blue rectangle, or a green circle. -
Modify your function so that entering any other string gives an outline black circle.
-
Write
proximity: number number -> string
.- If the first number is within 10 of the second number, then put out “neighbors”.
- If the first number is within 20 of the second number, then put out “close”.
- Otherwise put out “far”.
-
Write a
random-bw
function that takes in a width and a height, and produces an image with every pixel either black or white, randomly chosen.