[SOLVED] Brawler Hunt - incomplete: Humans must survive

Should I use something else. Help me please.

// Don't worry about small and medium-sized ogres.
// Your targets are type "brawler".
// When a "brawler" is closer than 50m, fire artillery.

while (true) {
    // Find the nearest enemy and the distance to it.
    var enemy = hero.findNearestEnemy();
    var distance = hero.distanceTo(enemy);
    if (enemy.type == "brawler" && distance < 50)
    {
        hero.say("Fire!");
    }
}
    // If the enemy's type is "brawler"
    // AND the distance to it is less than 50 meters,
    // Then say "Fire!" to signal the artillery.

use something else like what?

what? sorry I did not get it

use what? use what other things?

Your post dosen’t help. Can you write what I need to write in my code?

We can’t give you the code. Can you explain a bit further what happens when you run the code? Just saying Should I use something else. Help me please doesn’t tell us anything.

1111
I wrote all what were in the task. but code does not fit.

You had a bad luck with the seed, your code is right, I tried it. Change the hero, resubmit several times to get different seed and you will beat the level.

1 Like

Thank you very much. I changed hero and it helped.