1 What kind of triangle does the triangle
function produce?
There are lots of other kinds of triangles! And Pyret has lots of other functions that make triangles!
triangle
:: (size:: Number, style :: String, color :: String) > Image
righttriangle
:: (base::Number, height::Number, style::String, color::String) > Image
isoscelestriangle
:: (leg::Number, angle::Number, style::String, color::String) > Image
2 Why do you think triangle
only needs one number, while righttriangle
and isoscelestriangle
need two numbers and trianglesas
needs three?
3 Write righttriangle
expressions for the images below. One argument for each should be 100
.
4 What do you think the numbers in righttriangle
represent?
5 Write isoscelestriangle
expressions for the images below. 1 argument for each should be 100
.
6 What do you think the numbers in isoscelestriangle
represent?
7 Write 2 expressions that would build rightisosceles triangles. Use righttriangle
for one expression and isoscelestriangle
for the other expression.

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, and 1738598). 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.