Friend and Foe (help needed)

I can’t seem to solve the level “Friend and Foe” in Backwoods Forest. When I use my code(below) the peasants all get ready for battle and then the hero never says anything to the peons.

while True:
friend = hero.findNearestFriend()
enemy = hero.findNearestEnemy()
if friend:
hero.say("To battle, " + friend.id + “!”)

else:
    if enemy:
        hero.say("Go away," + "enemy.id")
2 Likes

Please, look for the theme where you asked that question. I answered you there.

2 Likes

This is what the code would be
[Please, don’t post solutions here]

2 Likes

[Please, don’t post solutions here]

1 Like

Please try not to revive dead topics as they will unnecessarily push them back up to the top of the topic list. :slight_smile:

1 Like

Please don’t revive dead topics. As @Hellenar said,

Please try not to revive dead topics as they will unnecessarily push them back up to the top of the topic list. :slight_smile:

I think these guys figured it out, especially since the last post was from 3 years ago.

1 Like

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