Question: I will provided more info In the chat class ThrowerAnt (Ant ) : ThrowerAnt throws a leaf each turn at the nearest Bee in its
I will provided more info In the chat

class ThrowerAnt (Ant ) : """ThrowerAnt throws a leaf each turn at the nearest Bee in its range. "" " name = 'Thrower' implemented = True damage = 1 food cost = 3 def nearest_bee (self ) : """Return the nearest Bee in a Place that is not the HIVE, connected to the ThrowerAnt's Place by following entrances. This method returns None if there is no such Bee (or none in range) . # BEGIN Problem 3 and 4 current_place = self . place while current place is not None: if not current_place. is_hive and current_place . bees: return random bee (current_place . bees) current_place = current_place . entrance return None # END Problem 3 and 4 class ShortThrower (ThrowerAnt ) : """A ThrowerAnt that only throws leaves at Bees at most 3 places away."" " name = 'Short' food cost = 2 # OVERRIDE CLASS ATTRIBUTES HERE # BEGIN Problem 4 implemented = True # Change to True to view in the GUI # END Problem 4 class LongThrower (ThrowerAnt ) : """A ThrowerAnt that only throws leaves at Bees at least 5 places away. " " " name = 'Long' food cost = 2 # OVERRIDE CLASS ATTRIBUTES HERE # BEGIN Problem 4 implemented = True
class Thrower Ant (Ant): """ThrowerAnt throws a leaf each turn at the nearest Bee in its range." name = 'Thrower' implemented = True damage = 1 food_cost = 3 def nearest_bee (self): """Return the nearest Bee in a Place that is not the HIVE, connected to the Thrower Ant's Place by following entrances. This method returns None if there is no such Bee (or none in range). # BEGIN Problem 3 and 4 current_place = self.place while current place is not None: if not current_place.is_hive and current place.bees: return random bee (current_place.bees) current_place = current_place.entrance return None # END Problem 3 and 4 class ShortThrower (Thrower Ant): """A ThrowerAnt that only throws leaves at Bees at most 3 places away." name = 'Short' food_cost = 2 # OVERRIDE CLASS ATTRIBUTES HERE # BEGIN Problem 4 implemented = True # Change to True to view in the GUI # END Problem 4 class LongThrower (ThrowerAnt): """A ThrowerAnt that only throws leaves at Bees at least 5 places away." name = 'Long' food_cost = 2 |||||| # OVERRIDE CLASS ATTRIBUTES HERE # BEGIN Problem 4 implemented = True ||||||
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
