Created
August 6, 2018 04:59
-
-
Save mbround18/71b9ff9e7408fbaf4579c4b9ed40c1c2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define a function to draw and fill an equalateral right | |
# triangle with the given hypotenuse length and color. This | |
# is used to create a roof shape. | |
def drawTriangle(t, length, color): | |
t.fillcolor(color) | |
t.begin_fill() | |
t.forward(length) | |
t.left(135) | |
t.forward(length / math.sqrt(2)) | |
t.left(90) | |
t.forward(length / math.sqrt(2)) | |
t.left(135) | |
t.end_fill() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment