-
-
Save mikezink/22f983b2d727ac9656f554b041dd950a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import turtle | |
def tree(branchLen,t): | |
if branchLen > 5: | |
t.forward(branchLen) | |
t.right(20) | |
tree(branchLen-15,t) | |
t.left(40) | |
tree(branchLen-15,t) | |
t.right(20) | |
t.backward(branchLen) | |
def main(): | |
t = turtle.Turtle() | |
myWin = turtle.Screen() | |
t.left(90) | |
t.up() | |
t.backward(100) | |
t.down() | |
t.color("green") | |
tree(75,t) | |
myWin.exitonclick() | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment