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...

A software implementation of chess was developed by GNU and is avail- able for free. How can you use the Internet to find and download this program?

What will be an ideal response?

Computer Science & Information Technology

A blog is short for ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

To turn off the To-Do Bar, click the View tab, in the Layout group, click the To-Do Bar button, and then click Off.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

A major difference between a malicious hacker and an ethical hacker is the _________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology