https://openai.com/blog/chatgpt
import turtle
import random
def tree(branchLen, t):
if branchLen > 5:
angle = random.randint(20, 30)
factor = random.uniform(0.6, 0.8)
t.pensize(branchLen / 10)
t.forward(branchLen)
t.right(angle)
tree(branchLen * factor, t)
t.left(angle * 2)
tree(branchLen * factor, t)
t.right(angle)
t.backward(branchLen)
def petal(t):
angle = random.uniform(0, 360)
t.pencolor("red")
t.fillcolor("pink")
t.begin_fill()
for i in range(10):
t.forward(10)
t.right(angle)
t.end_fill()
def main():
t = turtle.Turtle()
myWin = turtle.Screen()
t.left(90)
t.up()
t.backward(200)
t.down()
t.color("brown")
tree(100, t)
myWin.exitonclick()
main()