Reputation: 389
I was looking on this webpage http://openbookproject.net/thinkcs/python/english3e/recursion.html and there is a nice recursive solution for drawing a tree, so I decided to write the code myself to draw this "H tree" below.
What I needed help with was, is there a way to rotate the entire picture by 90 degrees? I tried starting the turtle off in a different angle (left by 90 degrees) and while this works for a depth of 1, it messed up a depth of 2.
Upvotes: 3
Views: 1107
Reputation: 28646
Yeah, just rotate before drawing, outside of the recursive function:
window = turtle.Screen()
turtle.right(90)
drawHTree(200,2)
Upvotes: 1