Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

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, " + + “!”)

    if enemy:
        hero.say("Go away," + "")


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


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


[Please, don’t post solutions here]


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