I’m pretty much clueless as to where to start here. Here’s what I have (I just started coding):
# horse = ?
horse = self.findFriends()
if horse:
self.pos = horse.pos
x1 = horse.pos.x - 7
x2 = horse.pos.x + 7
y = horse.pos.y
if x1 >= 1:
self.moveXY(x,horse.pos.y)
# Move to the horse's y position but use x1 for the x position.
elif x2 <= 79:
# Move to the horse's y position but use x2 for the x position.
distance = self.distanceTo(horse)
if distance <= 10:
self.say("Whoa")
self.moveXY(27, 54)
self.moveXY(43, 21)
# Move to the red x to return the horse to the farm.
# Move back out into the pasture to begin looking for the next horse.