Open the Table Functions Starter File on your computer, save a copy, and click "Run".
1 What is the name of the Table defined on line 5?
How many columns does it have? How many Rows?
2 What is the name of the Row defined on line 17?
3 What data type is red-circle
defined as: a Number, String, Image, Boolean, Table, or Row?
Type red-circle
into the Interactions Area. What do you get?
4 In the space provided on lines 19 and 20, add new definitions for two more Rows from this table.
5 Read the Contract on line 22.
What is the function’s name? Domain? Range?
6 Type is-red(blue-triangle)
into the Interactions Area. What do you get?
Then use the function is-red
, passing in a different row.
Explain what the is-red
function does.
7 What other functions are defined in the starter file?
For each of the remaining functions, read the code and try to guess what it does before testing it out by passing in a Row.
8 What does is-polygon
do?
9 What does lookup-name
do?
10 What does is-triangle
do?
11 Define two new functions: is-green
and is-blue
.
★ There is a hidden function called draw-shape
. Try to use it. What is its Domain and Range? What does it do?
★ How else could we define is-polygon
, without using the "polygon"
column at all?
These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927).
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.