I'm trying to draw grass and I'm struggling to make my drawing start from the bottom left then go all the way to the bottom right. I know there is something wrong with my code but can't figure it out.
The code I have starts from the middle and that's not what I want.
import turtle
import random
window = turtle.Screen()
bob = turtle.Turtle()
window.bgcolor("white")
window.title("TURTLE")
bob.pencolor("green")
window.colormode(255)
position = 0
height = 0
height11 = 0
height12 = 0
height13 = 0
height14 = 0
def draw_grass(bob):
green = random.randint (100, 200)
length = random.randint(10,20)
bob.fillcolor(0,green,0)
bob.begin_fill()
bob.setheading(90)
for i in range (2):
bob.forward(length)
bob.right(90)
bob.forward(3)
bob.right(90)
bob.end_fill()
bob.penup()
bob.pendown()
return length
for i in range (10):
height = draw_grass(bob)
position = position + 3
bob.goto(position, 0)
if height == 11 :
height11 = height11 + 1
elif height == 12:
height12 = height12 + 1
elif height == 13:
height13 = height13 + 1