Referenced from lesson Data Displays and Lookups
Consider the table below, and the four value definitions that follow:
shapes-table
name | corners | is-round |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
shapeA = shapes-table.row-n(0) shapeB = shapes-table.row-n(1) shapeC = shapes-table.row-n(2) shapeD = shapes-table.row-n(3)
1) Match each Pyret expression (left) to the description of what it evaluates to (right).
|
1 |
A |
Evaluates to |
|
|
2 |
B |
Evaluates to the last row in the table |
|
|
3 |
C |
Evaluates to |
|
|
4 |
D |
Evaluates to |
|
|
5 |
E |
Evaluates to |
|
|
6 |
F |
Evaluates to |
|
|
7 |
G |
Evaluates to the first row in the table |
2) Fill in the blanks (left) with the Pyret lookup code that will produce the value (right).
a. |
|
|
b. |
|
|
c. |
|
|
d. |
|
|
e. |
|
|
These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, and 1738598). Bootstrap:Integrated Oklahoma by Jen Poole 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.