# Only attack enemies of type "munchkin" and "thrower". # Don't attack a "burl". Run away from an "ogre"! while True: enemy = hero.findNearestEnemy() # Remember: don't attack type "burl"! if enemy.type == "burl": hero.say("I'm not attacking that Burl!") # The "type" property tells you what kind of creature it is. if enemy.type == "munchkin": hero.attack(enemy) # Use "if" to attack a "thrower". if enemy.type == "thrower": hero.attack(enemy) # If it's an "ogre", use moveXY to run away to the village gate! if enemy.type == "ogre": hero.moveXY(41, 47)