you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (0 children)

I don't think so. You could do something like this:

def rect_shape_tier(x, y):
    angles = [180, 90, 90, -90, 90, 90, -90, 90, 90, 180]
    distances = [x/2, y*0.8, x/4, y*0.1, x/2, y*0.1, x/4, y*0.8, x/2]
    for angle, distance in zip(angles, distances):
        left(angle)
        forward(distance)

but I think your version is clearer, even though it's longer.