Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def calculate_width(vertice):
- if vertice == None: return 0
- return 1 + calculate_width(vertice[1]) + calculate_width(vertice[2])
- def calculate_height(vertice):
- if vertice == None: return 0
- return 1 + max(calculate_height(vertice[1]), calculate_height(vertice[2]))
- def calculate_size(vertice):
- return calculate_width(vertice), calculate_height(vertice)
Advertisement
Add Comment
Please, Sign In to add comment