Hello all! I’ve been stuck on the levels above. Here’s my code for Yeti Away:
# Follow one of the peasants and escape from the yeti.
hero.phaseShift()
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, len(word))):
# Check the letter of phrase and word at index i
word = word[i]
phrase = phrase[i]
# If they are not equal:
if word != phrase:
# 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)
It worked the first time but on the second(third and so on) submit, my hero keeps following the top peasant
link(Yeti Away). As for the Medic School level, being very similar to Yeti way, should be easy to solve after solving the Yeti level. All help is appreciated