Forest Fire Dancing feedback

Please do not be impatient, but your problem is that you do not have anything to define else; You did code else, but you are not defining what else is for. Also, could you please paste your code to your post so it is easier for me to see?

1 Like

O.K. thx!!!

1 Like

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

1 Like

Oh, also read the FAQ to post your code correctly.

1 Like

For example,

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

just looks like you didn’t indent correctly.

1 Like

Where is the FAQs???

1 Like

In the top right corner, you will see three horizontal bars. Click on them, and you will see the FAQ with a new sign to the right of it.

1 Like

O.K. Thx!!!

1 Like

Looks like the “new” was taken off for me.

1 Like

I just tried your code. It did not work.

1 Like

:cry: Help!!!

1 Like

No, that was your code. I just used an example of what happens when you don’t read the FAQ and don’t know what to do.

1 Like

Oh. You are mean!!!

1 Like

BTW, I don’'t code JS

1 Like

But I can understand a little bit; I also code Java.

2 Likes

Oh. Thx anyway. This is my last post due to the first day thing. I can still edit this post and tell you stuff.

1 Like

The problem with your code is that you need to define what else is for. If you keep saying that else of else, the code messes up.

1 Like

You need the "elif"s, BTW.

1 Like

Ok. I got it. (20 chars)

1 Like

Sorry for being impolite.:relaxed:

1 Like