The Fierce Forces Topic

Yup! Although if you overcrowd a single lane you might just end up leaving your other two exposed. Make sure you are balanceing all lanes equally.

Like this.

units = ['phoenix', 'phoenix', 'snail', 'elemental', 'elemental', 'orb', 'orb']
1 Like

Nice job! I have to go now but feel free to @iggymaster99 me any time you need help.

Thank you!

I have been thinking for so long for how to do the spells properly! :slight_smile:

1 Like

@iggymaster99, I made this code and it works pretty well but doesn’t do the main Line more than 1

def mainLine(lane):
    hero.summon("phoenix", lane)
    hero.summon("orb", lane)
    hero.summon("snail", lane)
    hero.summon("phoenix", lane)
    hero.summon("orb", lane)
    hero.summon("orb", lane)
    hero.summon("elemental", lane)

def defendCircle():
    boulders = hero.findBoulders()  # Find the boulders (circle)
    enemies = hero.findEnemyUnits()    # Find enemy units

    for boulder in boulders:
        for enemy in enemies:
            distance = hero.distanceTo(boulder)  # Calculate distance to boulder
            if distance < 47:
                lane = enemy.lane
                hero.cast("push", lane, enemy.x - 5)
                fast_unit1 = "snail"
                fast_unit2 = "phoenix"
                fast_unit3 = "orb"
                    # Send fast units to intercept the enemy
                hero.summon(fast_unit2, lane)
                hero.summon(fast_unit1, lane)
                hero.summon(fast_unit3, lane)

while True:

It gets stuck in the for boulder in boulders and the enemy in enemies. It does defend the area perfectly but doesn’t use the mainline to get the other areas.

@Venneth There is a bug when you play on blue, it says “Can’t read protected property:health” for I’ve always used it and it’s even in my submitted code, but its evident that it’s crashing my submitted code because all the losses are against red. Here is the screenshot

Everything looks ok. Are you calling defendCircle() at all?

Welcome @Buddeycc! Make sure to read our FAQ , our guidelines, and remember to format your code! Have a good time!

Yes, at the end of the Main Line function.

I think that when I call defend circle it gets stuck in the for enemy in enemies loop.

Hey, does anyone know this?

@Venneth @Bryukh in the editor it seems that the removal of the health API was intentional, yet it was only applied to the red hero. It is useful for me, so could you add it back?

Ah oof, that wasn’t intentional, sorry for that, should be fixed and .health should be accessible again


Hey, guys!

Why did this suddenly happen??


It takes me about an hour to see my code results now.
Probably prioritize by recently submitted codes to not wait >1h?

@Venneth How does the idea sound?

1 Like

Hmmmmm. I dunno. Try to see what happens if you take out a for loop then run it. Just as a test.

Yeah that happens pretty frequently; when people just submit but don’t simulate any games.
hint hint wink wink simulate games everybody!


Hi guys. I have a piece of code that returns multiple variables but I don’t know how to access them. Would I do like

def analyzeLane(lane):
    lane = unitsCompare(lane)
    if lane(mass):


def analyzeLane(lane):
    lane = unitsCompare(lane)
    if lane.mass:
1 Like

if unitsCompare returns list of values, access by index.

def unitsCompare(lane):
    mass = True
    ans = [mass]
    return ans

lane = unitsCompare(lane)
if lane[0]:

you can also use dict.

def unitsCompare(lane):
    ans = {"mass": True}
    # ans = {}
    # ans["mass"] = True
    return ans

lane = unitsCompare(lane)
if lane["mass"]:

if you use other type, tell me about specification of it.


whats a lanes mass? :slight_smile:

1 Like