// Navigate through the woods, but be on the lookout!
// These forest cubbies may contain ogres!

hero.moveXY(19, 33);
var enemy = hero.findNearestEnemy();
// The if-statement will check if a variable has an ogre.
if(enemy) {
    hero.attack(enemy);
    hero.attack(enemy);
}

// Pokonaj ogry w ich własnym obozowisku!

while(true) {
    var enemy = hero.findNearestEnemy();
    // Użyj instrukcji warunkowej "if-statement", by sprawdzić czy wróg się pojawił:
    if (enemy) {
 
        // Zaatakuj wroga jeśli się pojawił:
    hero.attack(enemy);
    
    }    
}