Directions: Can you guess the contract for a function just by seeing how it’s used? Try to match each Expression in the left column with a Contract in the right column that describes the function being used. Some expressions or contracts might not have a match.
-
(big-star "purple"); big-star : Number String -> Image
-
(big-star 25 "gold"); message-cost : String -> Number
-
(message-cost 15); message-cost : Number -> Number
-
(message-cost "where are you?"); show-score : String String -> Image
-
(show-score "Red Sox" 6 "Cardinals" 4); show-score : String Number -> Image
-
(show-score "Red Sox" "Cardinals" 5 5); show-score : String Number String Number ; -> Image
-
(find-winner "Red Sox" 4 "Cardinals" 6); prefer-flavor : String String -> Number
-
(pick-flavor "vanilla" "oreo" "mint"); choose-flavor : String String -> String
-
(prefer-flavor "lemon" "lime"); pick-flavor : String String String -> Image
These materials were developed partly through support of the National Science Foundation,
(awards 1042210, 1535276, 1648684, and 1738598).
BS:Games by Jen Poole, Emmanuel Schanzer, Ed Campos Jr, and Dorai Sitaram
is licensed under a
Creative Commons 4.0 Unported License.
Based on a work at www.BootstrapWorld.org.
Permissions beyond the scope of this license may be available by contacting
schanzer@BootstrapWorld.org.