Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Need help on Friend and Foe


This is my code
while True:
friend = hero.findNearestFriend()
if friend:
hero.say("To battle, " + + “!”)
# Now find the nearest enemy and tell them to go away.
if enemy:
hero.say(“Go away”)


Be sure to surround your code in triple back ticks ( ` ) at the top and bottom so it properly formats.


You never define “enemy” in your code: enemy = ...


Can’t attack ! How come?
What should come after the Hero.say("")?


Post your code please