Desert combat plz help

# while-loops repeat until the condition is false.
ordersGiven = 0
while ordersGiven < 5:
    # Move down 10 meters.
    ordersGiven = ordersGiven +1.
# Order your ally to “Attack!” with hero.say
# They can only hear you if you are on the X.
hero.say ("Attack!")

# Be sure to increment ordersGiven!
while True:
    enemy = hero.findNearestEnemy()
    # When you’re done giving orders, join the attack.
    if enemy:
        hero.attack(enemy)

Change the ordersgiven + 1 to ordersgiven += 1

That would break it, change ordersGiven = ordersGiven +1. to ordersGiven += 1, and follow

this instruction

1 Like
# while-loops repeat until the condition is false.
ordersGiven = 0
while ordersGiven < 5:
    # Move down 10 meters.
    ordersGiven +=1.
    # Order your ally to “Attack!” with hero.say
    # They can only hear you if you are on the X.
    hero.say ("Attack!")

# Be sure to increment ordersGiven!
while True:
    enemy = hero.findNearestEnemy()
    # When you’re done giving orders, join the attack.
    if enemy:
        hero.attack(enemy)

my hero doesn’t move

Re-read my message (20 chars)

got it to work! :smiley: (20 characters)

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.