MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / main

Function main

src/gamesbyexample/kochsnowflake.py:9–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7LEVELS = 5 # More than 5 levels becomes too small to see.
8
9def 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
27def snowflakeSide(sideLength, levels):

Callers 1

kochsnowflake.pyFile · 0.70

Calls 1

drawSnowflakeFunction · 0.85

Tested by

no test coverage detected