()
| 7 | LEVELS = 5 # More than 5 levels becomes too small to see. |
| 8 | |
| 9 | def main(): |
| 10 | # Move turtle into the starting position: |
| 11 | LENGTH = 300.0 |
| 12 | turtle.penup() |
| 13 | turtle.backward(LENGTH / 2.0) |
| 14 | turtle.right(90) |
| 15 | turtle.backward(1.75 * LENGTH / 2.0) |
| 16 | turtle.left(90) |
| 17 | turtle.pendown() |
| 18 | |
| 19 | # Draw the snowflake: |
| 20 | for lev in range(LEVELS): |
| 21 | drawSnowflake(LENGTH, lev) |
| 22 | |
| 23 | turtle.update() # Finish drawing the screen. |
| 24 | turtle.exitonclick() # When user clicks on the window, close it. |
| 25 | |
| 26 | |
| 27 | def snowflakeSide(sideLength, levels): |
no test coverage detected