Look up Koch’s snowflake. Write a recursive function with turtles to create Koch’s snowflake.

Note: The answer can’t go too “deep” since the turtles are imprecise (in that they have to use int values)

```
def kochSnowflake(sides, size):
earth = World(1000, 1000)
suzy = Turtle(earth)
for s in range(sides):
kochCurve(suzy, size, sides-1)
turn(suzy, int(360/float(sides)))

def kochCurve(t, size, degree):
if degree==0:
forward(t, int(size))
else:
kochCurve(t, size/3.0, degree-1)
turn(t, -60)
kochCurve(t, size/3.0, degree-1)
turn(t, 120)
kochCurve(t, size/3.0, degree-1)
turn(t, -60)
kochCurve(t, size/3.0, degree-1)
```

Computer Science & Information Technology

You might also like to view...

Hard drives can hold a maximum of 1,000 megabytes and can easily fit into your pocket

Indicate whether the statement is true or false

Computer Science & Information Technology

Which command can be used to make sure a group policy has been applied to a domain computer?

A) MSDIAG B) MSCTC C) GPRESULT D) REGSERV

Computer Science & Information Technology