Hi, I need help with level 10 of the Sarven Desert. The system says that there are no errors in the code, but my character just doesn’t go and get the water.
# Race munchkins to the water distilled by Omarn Brewstone! # The continue statement is powerful for managing complicated logic. # When the program uses the continue statement, the rest of the loop is skipped. # However, unlike with "break", the loop repeats instead of stopping. # Use "continue" to verify the conditions of the ambush. loop: enemy = self.findNearestEnemy() item = self.findNearestItem() # If there is no enemy, continue out of the loop. if not enemy: continue # If there is an enemy, but no item, ask for a potion and continue out of the loop. if not item: self.say("Give me a drink!") continue # Use an if-statement to check the item's type. If the type is "poison", continue out of the loop. if item.type = "poison": continue # If it is not, the potion must be a bottle of water, so walk to it and return to the starting position! else: self.moveXY(item.pos.x, item.pos.y) self.moveXY(32, 47) continue continue
Any help would be appreciated.