Hack-and-dash? seems broken


#1

https://codecombat.com/play/level/hack-and-dash?

code: 

// You can write code before a loop.
// Break open the "Chest" before using the loop to escape the maze!
this.moveRight();
this.moveUp();
this.attack("Chest");
this.moveDown();

var i = 0;
while(i < 3)
    // Move 3 times.
    hero.moveRight(3);    
    hero.moveDown(3);
    i ++;

keeps running right ignoring the hero.moveDown(3);


#2

Your code is missing two curly brackets; one after the while and one underneath like this:

var i = 0;
while(i < 3) {
// Move 3 times.
    hero.moveRight(3);    
    hero.moveDown(3);
    i ++;
}

Hope that solves the problem.


#3

I’m using python, indentations only should work. It worked before.


#4

That’s strange, your code came up on my screen as in java. Well, anyway, if you are using python, then your code is only missing a : after your while loop

i = 0

while i < 3:
    hero.moveRight(3)
    hero.moveDown(3)
    

#5

BreninLlwyd is correct. Your code is not python, it’s JS. In python, comments are preceeded by a "#" sign and in JS, comments are preceeded by a double "//". Also, semi-colons are not used in python. The code you posted in the original post is JS.