Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

[SOLVED] Volcano Fighters'

# Complete the paladin rectangle to protect the village.

# This function finds the left-most unit.
def findMostLeft(units):
    if len(units) == 0:
        return None
    mostLeft = units[0]
    for unit in units:
        if unit.pos.x < mostLeft.pos.x:
            mostLeft = unit
    return mostLeft

# This function finds the bottom-most unit:
def findMostBottom(units):
    if len(units) == 0:
        return None
    mostBottom = units[0]
    for unit in units:
        if unit.pos.y < mostBottom.pos.y:
            mostBottom = unit
    return mostBottom

paladins = hero.findByType("paladin")
# Find the top left paladin with findMostLeft function:

# Find the bottom right paladin with findMostBottom function:


# Use X coordinate from the top left paladin:
# and Y coordinate from the bottom right paladin:

# Move to the {X, Y} point from the previous step:

# Continue to shield while the volcano is erupting:
while true:
    hero.shield()

This is the code on volcano fighters. I did not change the code. On the second last line, it is “while true”, not “while True”. Can you guys change it? Thanks!

Thank you for reporting this.
Here’s a post I made about that if you want to learn how to do it yourself:


But go to languages instead of comments.
Unfortunately I cannot guarantee that it will be accepted any time soon, the last patch I’ve seen submitted is around January. But at least they’re still getting accepted! Musn’t grumble
Danny

Thank you very much :slight_smile:

1 Like