| 81 | self.store(dog, entity) |
| 82 | |
| 83 | def clear_column(dog: Dog, top: Point, height: int, depot: Optional[Depot]): |
| 84 | start = top + Point(0, -1) |
| 85 | success = dog.goto(start) |
| 86 | if not success: |
| 87 | dog.approach(start) |
| 88 | (char, _, _) = dog.scan() |
| 89 | dog.send(f"PICK {char}") |
| 90 | if depot: |
| 91 | depot.store(dog, char_name_map[char]) |
| 92 | else: |
| 93 | dog.drop_within(TRASH_ZONE) |
| 94 | return clear_column(dog, top, height, depot) |
| 95 | dog.face("S") |
| 96 | while dog.location != Point(top.x, top.y + height): |
| 97 | (char, _, _) = dog.scan() |
| 98 | if char == ".": |
| 99 | dog.move() |
| 100 | else: |
| 101 | dog.pick(char) |
| 102 | if depot: |
| 103 | depot.store(dog, char_name_map[char]) |
| 104 | else: |
| 105 | dog.drop_within(TRASH_ZONE) |
| 106 | clear_column(dog, top, height, depot) |
| 107 | |
| 108 | def clear_area(dog: Dog, area: Rect, depot: Optional[Depot]): |
| 109 | for x in range(area.width() + 1): |