Created
February 16, 2019 15:42
-
-
Save vicradon/c05ae803071d05b7b8060f3e863e8bcf 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
from turtle import * | |
speed(0), ht() | |
diff, a = 0.6, 45 | |
def tree(d, n): | |
'this function uses recursion to draw' | |
if n > 1: | |
fd(d) | |
lt(a) | |
tree(d*diff, n-1) | |
rt(2*a) | |
tree(d*diff, n-1) | |
lt(a), bk(d) | |
lt(90), bk(100) | |
tree(100, 8) | |
exitonclick() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment