My hero doesn’t seem to follow the peasant with “mac” in their name. He keeps on moving towards the top path and by the time he gets there, he’s dead. Here is my code:
# Follow one of the peasants and escape from the yeti.
def startsWith(phrase, word):
if len(word) > len(phrase):
return False
# Iterate indexes from 0 to the length of the word.
for i in range(len(0, word)):
# Check the letter of phrase and word at index i
# If they are not equal:
if phrase[i] != word[i]:
# Then return False.
return False
# All letters in the word checked, then return true.
return True
# Follow the local guide whose name starts with "Mac".
guides = hero.findFriends()
for gIndex in range(len(guides)):
guide = guides[gIndex]
if startsWith(guide.id, "Mac"):
while True:
hero.move(guide.pos)
Also, the level already seems to say success without there being any code written by me: