while True: friend = hero.findNearest(hero.findFriends()) if friend: hero.moveXY(friend.pos.x, friend.pos.y - 6)
What’s wrong with my solution?
Everything looks ok when executed, except at the last part when they are lined up in a straight line. One other “friend” who is not my dance partner takes my spot in line behind my dance partner and my hero is forced to the end of the line.
Not sure if that’s why it’s not completing, and if so how to solve it?
Everything looks ok until that point at the end. I don’t know what else could be wrong. Please help. Thank you!