Alright, so for the lab I have to do using turtle in python I have to draw an H and then draw H's off of each end of the first H at a 45 degree angle and switch the color between blue and orange. The first H has to be blue and then alternate from there.
I have the drawing of the H's done but I can't figure out how to make it draw the right color without it either drawing back over itself with the wrong color or not having the first H be blue.
I feel like my check for the turtle color may be wrong. I got rid of the use of the check function from the program because it wasn't working.
This is the code that I have so far:
def Initilize():
turtle.clearscreen()
turtle.left(90)
turtle.color('blue')
def Check():
if turtle.color == 'orange':
turtle.color('blue')
else:
turtle.color('orange')
def DrawH(n,s):
if n == 0:
return
else:
turtle.left(90)
turtle.forward(s/2)
turtle.right(90)
turtle.forward(s/2)
turtle.left(45)
DrawH(n-1,s/2)
turtle.right(45)
turtle.back(s)
turtle.right(180)
turtle.right(45)
DrawH(n-1,s/2)
turtle.left(45)
turtle.right(180)
turtle.forward(s/2)
turtle.right(90)
turtle.forward(s)
turtle.left(90)
turtle.forward(s/2)
turtle.right(45)
DrawH(n-1,s/2)
turtle.left(45)
turtle.right(180)
turtle.forward(s)
turtle.left(45)
DrawH(n-1,s/2)
turtle.right(45)
turtle.right(180)
turtle.forward(s/2)
turtle.left(90)
turtle.forward(s/2)
turtle.right(90)