- Joined
- Dec 5, 2022
- Messages
- 2
- Reaction score
- 0
def draw_forest(win):
therow = 0
trees = 0
y = 14
tree_num = 1
list_of_trees = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
while therow < 10:
x = 14
while trees < 15:
tree = Tree(Point(x,y), "0_tree.png", tree_num)
image = Image(tree.get_point(), tree.get_image())
image.draw(win)
x += 29
tree_num += 1
trees += 1
y += 29
trees = 0
therow += 1
list_of_trees = [list_of_trees] * therow
print(list_of_trees)
return list_of_trees
How to display the following using onject oriented projramming.
therow = 0
trees = 0
y = 14
tree_num = 1
list_of_trees = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
while therow < 10:
x = 14
while trees < 15:
tree = Tree(Point(x,y), "0_tree.png", tree_num)
image = Image(tree.get_point(), tree.get_image())
image.draw(win)
x += 29
tree_num += 1
trees += 1
y += 29
trees = 0
therow += 1
list_of_trees = [list_of_trees] * therow
print(list_of_trees)
return list_of_trees
How to display the following using onject oriented projramming.