1 Let’s define a function rs
to generate solid red squares of whatever size we give them!
If I say rs(5)
, what would our actor need to say?
Let’s write a few more examples:
rs( ) →
rs( ) →
rs( ) →
What changes in these examples? Name your variable(s):
Let’s define our function using the variable:
fun rs( ): end
2 Let’s define a function bigc
to generate big solid circles of size 100 in whatever color we give them!
If I say bigc("orange")
, what would our actor need to say?
Let’s write a few more examples:
bigc( ) →
bigc( ) →
bigc( ) →
What changes in these examples? Name your variable(s):
Let’s define our function using the variable:
fun bigc( ): end
3 Let’s define a function ps
to build a pink star of size 50, with the input determining whether it’s solid or outline!
If I say ps("outline")
, what would our actor need to say?
Write examples for all other possible inputs:
ps( ) →
ps( ) →
What changes in these examples? Name your variable(s):
Let’s define our function using the variable:
fun ps( ): end
4 Add these new function definitions to your gt Starter File and test them out!
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.