Reputation: 31
This is my script:
import turtle
import random
wn = turtle.Screen()
poe = turtle.Turtle()
wn.bgcolor("grey")
colors = ["cyan", "purple", "white", "blue"]
poe.penup()
poe.forward(90)
poe.left(45)
poe.pendown()
def branch():
for i in range(3):
for i in range(3):
poe.forward(30)
poe.backward(30)
poe.right(45)
poe.left(90)
poe.backward(30)
poe.right(90)
poe.forward(90)
for i in range(8):
branch()
poe.left(45)
wn.exitonclick()
I just draws a weird squareflake. I got this code from https://projects.raspberrypi.org/en/projects/turtle-snowflakes/
Upvotes: 2
Views: 224
Reputation: 13888
Look at the project again and compare with your code. You're missing a line in your code:
def branch():
for i in range(3):
for i in range(3):
poe.forward(30)
poe.backward(30)
poe.right(45)
poe.left(90)
poe.backward(30)
poe.left(45) # <---- This line
poe.right(90)
poe.forward(90)
You also had a typo in the project link shared. I would advise you to be more careful and double check your work. A missing line, or character, or even a missed indentation can be catastrophic to your program.
Upvotes: 1