Clash of Clones [c++] help

Hero not moving at all.

Can someone take a look, what wrong with my code.

int main() {
    // You'll need good strategy to win this one!
    // Your clone will have the same equipment you have!
    // But, they're not very skilled at using special powers.
    while(true) {
        auto e_index = 0;
        auto enemies = hero.findEnemies();
        while(e_index > enemies.length && hero.health > hero.maxHealth / 4){
            auto enemy = enemies[e_index];
            if(enemy.health > 0 && enemy.type != "sand-yak"){
                hero.move(enemy.pos);
                if(hero.isReady("cleave"))
                    hero.cleave(enemy);
                else {
                    hero.attack(enemy);
                    if(hero.isReady("bash")){
                        hero.bash(enemy);
                    }else{
                        hero.attack(enemy);
                        hero.shield();
                    }
                    hero.shield();
                }
                if(hero.health < hero.maxHealth / 4){
                    break;
                }
            }
            e_index++;
        }
    }
    
    hero.moveXY(33, 71);
    return 0;
}

Don’t see anything wrong but my brain is fried since it’s 40 degrees here, soo

Hero not moving at all.

Try run the code does it does the same thing.

I don’t have premium, I can’t use c++