[SOLVED] Brawler Hunt - incomplete: Humans must survive


#1

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.

#2

use something else like what?


#3

what? sorry I did not get it


#4

use what? use what other things?


#5

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


#6

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.


#7


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


#8

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.


#9

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