Draw a tree

From Devipedia

Jump to: navigation, search
from turtle import *

def tree(x):

    if x < 5:
        return
    forward(x)
    right(30)
    tree(x-10)
    left(60)
    tree(x-10)
    right(30)
    back(x)

left(90)
tree(80)

From example here:

http://www.toplap.org/index.php/Live_coding_of_graphics

Personal tools