# Use different colored flags to perform different tasks.
while True:
flagGreen = hero.findFlag("green")
flagBlack = hero.findFlag("black")
# If there's a flagGreen...
# Build a "fence" at flagGreen's position.
# Pick up the flag!
# If there's a flagBlack...
# Build a "fire-trap" at flagBlack's position.
# Pick up the flag!
# Move back to the center.
hero.moveXY(43, 31)
After you define flagGreen, check if it exists with an if statement. Inside of that if statement, build a fence at flagGreen’s position x and position y. and pick the flag up Next, check if there is flagBlack. Inside of that if statement, build a fire-trap at its position x and y and pick it up. When you are submitting, if the scouts say there us an ogre coming, use a black flag. if there is a sand yak, use a green flag.