from cs1graphics import * paper = Canvas(300, 200, 'white') w = 200.0 h = 30.0 numPickets = 20 woodColor = 'tan' indivWidth = w / (2*numPickets -1 ) fence = Layer() for centerH in [h/3, 2*h/3]: cross = Rectangle(w, indivWidth) cross.move(w/2, -centerH) cross.setFillColor(woodColor) cross.setDepth(51) fence.add(cross) for p in range(numPickets): picket = Rectangle(indivWidth, h) picket.setFillColor(woodColor) picket.move(indivWidth/2 + 2*indivWidth*p, -h/2) fence.add(picket) fence.setDepth(1) fence.move(50,185) paper.add(fence)