Forest Fire Dancing Help (JavaScript)


#1

Hi I have a problem with level Forest Fire Dancing.
Can you identify the problem with code?

while (true) {
var evilstone = hero.findNearestItem();
if (evilstone) {
var pos = evilstone.pos;
if (pos.x == 34) {
hero.moveXY(46, 22);
} else {
var evilstone = hero.findNearestItem();
}
if (evilstone) {
var pos = evilstone.pos;
if (pos.x == 46) {
hero.moveXY(34, 22);
}
} else {
var evilstone = hero.findNearestItem();
if (!evilstone) {
hero.move(40, 22);
}
}
}
}

P.S. Sorry if my engilsh is bad.


#2

if (!evilstone) {
hero.move(40, 22); hero.moveXY(x,y)