(ammo, blast_strength, items, dist, my_position)
return False
Returns whether we can safely bomb right now.

        Decides this based on:
        1. Do we have ammo?
        2. If we laid a bomb right now, will we be stuck?
Returns whether we can safely bomb right now.
Returns whether we can safely bomb right now .
def _maybe_bomb(ammo, blast_strength, items, dist, my_position):
        """Returns whether we can safely bomb right now.

        Decides this based on:
        1. Do we have ammo?
        2. If we laid a bomb right now, will we be stuck?
        """
        # Do we have ammo?
        if ammo < 1:
            return False

        # Will we be stuck?
        x, y = my_position
        for position in items.get(constants.Item.Passage):
            if dist[position] == np.inf:
                continue

            # We can reach a passage that's outside of the bomb strength.
            if dist[position] > blast_strength:
                return True

            # We can reach a passage that's outside of the bomb scope.
            position_x, position_y = position
            if position_x != x and position_y != y:
                return True

        return False
def _maybe_bomb ( ammo , blast_strength , items , dist , my_position ) : # Do we have ammo? if ammo < 1 : return False # Will we be stuck? x , y = my_position for position in items . get ( constants . Item . Passage ) : if dist [ position ] == np . inf : continue # We can reach a passage that's outside of the bomb strength. if dist [ position ] > blast_strength : return True # We can reach a passage that's outside of the bomb scope. position_x , position_y = position if position_x != x and position_y != y : return True return False