If-stravaganza

Surrounded on all sides by incoming ogres! Wait for the right time to attack, then strike!

https://codecombat.com/play/level/if-stravaganza

Solution

// Defeat the ogres from within their own camp!

while(true) {
    var enemy = hero.findNearestEnemy();
    // Use an if-statement to check if an enemy exists:
    if(enemy){
        // Attack the enemy if it exists:
        hero.attack(enemy);
    }  
}
Points for
damage-taken
damage-dealt
Needed items with
attack
findNearestEnemy
This site is in another language version