Code:
hero.moveXY(14, 24);
var secretA = hero.findNearestFriend().getSecretA();
var secretB = hero.findNearestFriend().getSecretB();
var secretC = secretA && secretB;
if (secretC)
hero.moveXY(20, 33);
else
hero.moveXY(20, 15);
hero.moveXY(26, 24);
if (secretA === true || secretB === true) {
hero.moveXY(38, 24);
}
if (secretB !==true) {
hero.moveXY(50, 24);
}
Vanessa:
secretB !==true
Why did you do this? I feel like the !== is wrong. This: != means it does not equal something. (For instance (python), if enemy.type != "munchkin":
This: == means it does equal something. (For instance, if enemy.type == "witch":
) By doing !== you’re making it unequal and equal to something.
…Maybe it’s =! or !=. Now I can’t remember if it’s the exclamation point first or not.
1 Like
Aya
August 26, 2021, 5:19am
4
The exclamation mark is first !=
2 Likes
It still says run out of time. It also provides an error that says use !== To compare with true. I will send you a screenshot later I’m on phone.
Aya
August 28, 2021, 5:01pm
7
I’m not very familiar with Javascript, but shouldn’t the move statements be in {} ?
Your right, I got father to the treasure but not yet.
And thats strange, I didnt put that there…
Aya
August 28, 2021, 5:08pm
10
If you can show your newest code, that’ll be good
c-can someone help me?? ;(
Oof I’m on a phone rn but my code is at the top of the topic
Woopsy, didn’t notice, thanks.
1 Like
I think 1 ur moveXy is wrong and 2 maybe u have an error?
Oh i managed to beat it but thanks
system
Closed
August 30, 2021, 7:14am
19
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.