Match each Example on the left with the Contract on the right. NOTE: Multiple examples may match to the same contract!

Contract Examples

(EXAMPLE (match (circle 10 "solid" "green")) (rotate 37 (circle 10 "solid" "green")))

1

A

; match :: Number, Image -> Image

(EXAMPLE (match (triangle 20 "solid" "blue") 3) (scale 3 (triangle 20 "solid" "blue")))

2

(EXAMPLE (match (circle 20 "outline" "gold")) (rotate 37 (circle 20 "outline" "gold")))

3

B

; match :: Image, Number -> Image

(EXAMPLE (match 30 "red") (+ 30 (string-length "red")))

4

(EXAMPLE (match (circle 10 "solid" "orange") 22) (scale 22 (circle 10 "solid" "orange")))

5

(EXAMPLE (match 10 "blue") (+ 10 (string-length "blue")))

6

C

; match :: Image -> Image

(EXAMPLE (match 5 (star 20 "solid" "red")) (rotate (- 90 5) (star 20 "solid" "red")))

7

(EXAMPLE (match (abs -4) "45") 4)

8

D

; match :: Number, String -> Number

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, and 1738598). CCbadge Bootstrap by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.