[SOLVED] Stuck on hunting party

is this right at all

Put 4 spaces before this lines and then it would be all right.
Let me know when have you finished the level, ok?

do I put the spaces in-between the if or else

can you just show me what you did
hello you still there

Yes. Put 4 spaces before those lines:

And you will complete the level.
Do you need any more assistance at this level?

it isn’t working at all
ok ill show wat I have so far

while True:
    friends = hero.findFriends()
    # Use for-loop and for each friend:
    for friend in friends:
        enemy = friend.findNearestEnemy()
    
if enemy:
    hero.command(friend, "attack", enemy)
    
else:
    hero.command(friend, "move", {"x": friend.pos.x + 5, "y": friend.pos.y})

hello you there it is so hard can you show me the code you did

No I can not! Here we do not post solutions, try to understand that! :rage:

Put this inside the for friend in friends.

sorry if I’m being a dumb person
yes I understand
ok I cant do this I’m thick

Can you understand what am I trying to say?

I cant do this I’m stupid

Here is a portion of it:

    for friend in friends: 
        enemy = friend.findNearestEnemy() 
        if enemy: 
            hero.command(friend, "attack", enemy) 
        else: 
            hero.command(friend, "move", {"x": friend.pos.x + 5, "y": friend.pos.y})

Do you need any more assistance at this level?

ok I did it thanks so much

1 Like

No problem! And sorry for the rage!

its ok I understand why you raged

1 Like

But I should not have done it. Can you forgive me?

1 Like

I forgive you ok I’m sorry as well

1 Like

do you need any help at all