(points, depth)
| 44 | |
| 45 | |
| 46 | def triangle(points, depth): |
| 47 | myPen.up() |
| 48 | myPen.goto(points[0][0], points[0][1]) |
| 49 | myPen.down() |
| 50 | myPen.goto(points[1][0], points[1][1]) |
| 51 | myPen.goto(points[2][0], points[2][1]) |
| 52 | myPen.goto(points[0][0], points[0][1]) |
| 53 | |
| 54 | if depth > 0: |
| 55 | triangle( |
| 56 | [points[0], getMid(points[0], points[1]), getMid(points[0], points[2])], |
| 57 | depth - 1, |
| 58 | ) |
| 59 | triangle( |
| 60 | [points[1], getMid(points[0], points[1]), getMid(points[1], points[2])], |
| 61 | depth - 1, |
| 62 | ) |
| 63 | triangle( |
| 64 | [points[2], getMid(points[2], points[1]), getMid(points[0], points[2])], |
| 65 | depth - 1, |
| 66 | ) |
| 67 | |
| 68 | |
| 69 | triangle(points, int(sys.argv[1])) |
no test coverage detected