[Adventurer] Trojan Yeti

Mountain level here: Trojan Yeti

The second level in trim series. Wereyeti like time-bombs – you can wipe out your enemies, but also you can blow yourself.

3 Likes

On a few of the seeds I ran out of time. The third time I submitted worked.

submitted grammar patch
Same challenge with LUA as the other trim() level

1 Like

Hm. Interesting. I tested it many times. Anyway, added 10 seconds. Thanks!

1 Like

I tried again with 4 submits and all worked this time. Looks like it is good.

1 Like

Thank you! You save me with English.

1 Like

The yetis keep getting killed by the ogres. What should I do?

1 Like

Could you show your code or say your CoCo username?

1 Like

I managed to beat the level by attacking the ogres when a little after killing the yetis. I shouldn’t have to do that. Here is my code(without attacking):

# You need to defeat ogres.
# Send wereyeti peasants to the ogre camp and watch.

# This function returns a friendly unit by the name.
def findFriendByName(name):
    friends = hero.findFriends()
    for i in range(len(friends)):
        if friends[i].id == name:
            return friends[i]
    return None

# The sergeant wrote the list of wereyeti peasants' names.
sergeant = hero.findNearest(hero.findFriends())
wereList = sergeant.wereList
# The list isn't clean and contains redundant spaces. 
wereNames = wereList.split(",")

# Iterate through wereNames array:
for wereName in wereNames:
    # Trim the whitespace from the name
    # and save it in the new variable:
    wereName = wereName.trim()
    # Use findFriendByName function to find a wereyeti:
    wereYeti = findFriendByName(wereName)
    # Command that unit move to the ogre camp:
    hero.command(wereYeti, "move", {"x":48,"y":48})
1 Like

code I added to attack:

hero.wait(25)
hero.moveXY(23, 46)
while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        hero.attack(enemy)
1 Like

Your code looks correct. Try to re-submit it, maybe it’s a “bad seed”

1 Like

Worked. Thanks!
(20 characters needed)

1 Like