def valid_positions(me, things): return [ position for position in adjacent_positions(me) if things.get(position) == None or ( hasattr(things.get(position), "name") and things.get(position).name not in ["tree", "tower"]) ]
def noob_hero_logic(self, things, t): actions = 'move', 'attack', 'fireball', 'heal', 'stun' positions = adjacent_positions(self.position) return choice(actions), choice(positions)
def valid_positions(me, things): return [position for position in adjacent_positions(me) if (hasattr(things.get(position), "name") and things.get(position).name not in ["tree", "tower"]) or things.get(position) == None]