Referenced from lesson Defining Functions
Examples | Definition | |||
---|---|---|---|---|
examples:
mystery(30) is circle(30, "solid", "red")
mystery(10) is circle(10, "solid", "red")
end |
2 |
A |
fun mystery(w):
rectangle(w, 10, "outline", "red")
end |
|
examples:
mystery(2) is 2 + 2
mystery(4) is 4 + 4
mystery(5) is 5 + 5
end |
5 |
B |
fun mystery(num):
num * 2
end |
|
examples:
mystery("red") is circle(10, "solid", "red")
mystery("orange") is circle(10, "solid", "orange")
end |
1 |
C |
fun mystery(num):
num + num
end |
|
examples:
mystery(30) is rectangle(20, 30, "solid", "red")
mystery(20) is rectangle(20, 20, "solid", "red")
mystery(10) is rectangle(20, 10, "solid", "red")
end |
4 |
D |
fun mystery(h):
rectangle(20, h, "solid", "red")
end |
|
examples:
mystery(30) is rectangle(30, 10, "solid", "red")
mystery(10) is rectangle(10, 10, "solid", "red")
end |
3 |
E |
fun mystery(r):
circle(r, "outline", "red")
end |
|
5 |
F |
fun mystery(c):
circle(10, "solid", c)
end |
These materials were developed partly through support of the National Science Foundation,
(awards 1042210, 1535276, 1648684, and 1738598).
Bootstrap:Algebra by Emmanuel Schanzer, Jen Poole, Ed Campos Jr, Flannery Denny, 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.