What are variables useful for?
Draw what the following script would draw when run.
function main() var n := 0 for 0 ≤ i < 4 do turtle→forward(50) turtle→left turn(n) n := n + 90 end for end function
Draw what the following script would draw when run.
function do something( a: Number) do turtle→left turn(a) turtle→forward(100) turtle→right turn(a) end function function main() do something(90) turtle→forward(100) do something(45) end function
Create a script with a function called
draw square
with one parametersize
. The function should draw a square with the side length specified by the parametersize
.