diff --git a/shapes.py b/shapes.py index 731ec39..12822fc 100644 --- a/shapes.py +++ b/shapes.py @@ -2,10 +2,37 @@ # --------- # By MWC contributors -from turtle import * +from turtle import forward, right, left, penup, pendown, goto def triangle(side_length): - pass + forward(side_length) + right(120) + forward(side_length) + right(120) + forward(side_length) + left(120) def rectangle(height, width): - pass + forward(width) + right(90) + forward(height) + right(90) + forward(width) + right(90) + forward(height) + right(90) + +def flyto(x, y): + penup() + goto(x, y) + pendown + +flyto(-100, 0) +rectangle(2, 4) +rectangle(4, 8) +rectangle(8, 16) +flyto(100,0) +triangle(10) +triangle(20) +triangle(30) +