Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def count_shadows(self, tree: Tree):
- cell: Cell = self.board[tree.cell_index]
- shadows = 0
- for day in range(6):
- distance = 0
- is_shadow = False
- c: Cell = self.board[tree.cell_index]
- while distance < 3:
- c: Cell = self.board[c.neighbors[day]]
- t: Tree = self.get_tree(c.cell_index)
- if t and t.cell_index >= 0 and t.size > distance and t.size >= tree.size:
- is_shadow = True
- distance += 1
- if is_shadow: shadows += 1
- return shadows
Add Comment
Please, Sign In to add comment