Logical Circle Javascript [SOLVED]


#1
// Move to the wizard and get their secret values.
hero.moveXY(20, 24);
var secretA = hero.findNearestFriend().getSecretA();
var secretB = hero.findNearestFriend().getSecretB();
var secretC = hero.findNearestFriend().getSecretC();

// If ALL three values are true, take the high path.
// Otherwise, take the low path. Save the 4th value.
var secretD = secretA && secretB && secretC;
if (secretD) {
    hero.moveXY(30, 33);
}else{
    hero.moveXY(30, 15);
}
// If ANY of the three values are true, take the left path.
// Otherwise, go right. Save the 5th value.
var secretE = secretA || secretB || secretC;
if (secretE) {
    hero.moveXY(20,24);
}else{
    hero.moveXY(40,24);
}

// If ALL five values are true, take the high path.
// Otherwise, take the low path.
if (secretD && secretE){
    hero.moveXY(30,33);
}

I don’t understand what I am doing wrong?


#2

ok so if I tested the level under “run” it completed and then click “submit” it is coming back as “ran out of time”. I tried resetting the level several times and nothing, I left, came back it said “complete” however on a “run and submit” it did the same thing…

I tried leaving and coming back then just submit it says I ran out of time again… but every time I enter the mission it is defaulting to complete? The marker on the main map is saying I have not yet complete it either… ??

I tried making the last line

if (secretA && secretB && secretC && secretD && secretE){
    hero.moveXY(30,33);
}

and it still failed,

(OOOOOOOOOOO I WAS MISSING THE ELSE GO SOUTH! I GOT IT!!!) Solved, solved! Sorry about that folks!!!