[SOLVED] Could you help me on logical path

hero.moveXY(14, 24)
secretA = hero.findNearestFriend().getSecretA()
secretB = hero.findNearestFriend().getSecretB()
secretC = secretA and secretB
if secretC:
    hero.moveXY(20, 33)
else:
    hero.moveXY(20, 15)
hero.moveXY(26, 24)
if secretA or secretB == "true":
    hero.moveXY(32, 33)
else:
    hero.moveXY(32, 15)
if secretA and secretB == "true":
    hero.moveXY(38, 24)
if secretB != "true":
    hero.moveXY(44, 33)
else:
    hero.moveXY(44, 15)
if secretB != "true":
    hero.moveXY(50, 24)

this is my code

The problem is that you’ve used “true” instead of True (capital T).
You should be able to finish the rest. (remember to move back to the middle)
Danny

but it still does not work any other help?
I still die.

I reset It to try the thing again

ok this is my code

hero.moveXY(14, 24)
secretA = hero.findNearestFriend().getSecretA()
secretB = hero.findNearestFriend().getSecretB()

# If BOTH secretA and secretB are true, take the high path; otherwise, take the low path.
secretC = secretA and secretB
if secretC:
    hero.moveXY(20, 33)
else:
    hero.moveXY(20, 15)
hero.moveXY(26, 24)

# If EITHER secretA or secretB is true, take the high path.
secretD = secretA or secretB
if secretD:
    hero.moveXY(32, 33)
hero.moveXY(38, 24)
# If secretB is NOT true, take the high path.
if secretB != "true":
    hero.moveXY(44, 33)
else:
    hero.moveXY(44, 15)
hero.moveXY(50, 24)

It’s the same as what I just said. If you change that you get success.

1 Like

yea but I still die no matter what

Can you post your current code and screenshot of both your equipment, and of your level screen.

this is my equipment [file:///home/chronos/u-88782abd30cdb7ddf2b0e179fd1fd2a1c4e39df5/MyFiles/Downloads/Screenshot%202019-11-03%20at%202.09.08%20PM.png](file:///home/chronos/u-88782abd30cdb7ddf2b0e179fd1fd2a1c4e39df5/MyFiles/Downloads/Screenshot%202019-11-03%20at%202.09.08%20PM.png)

what do you mean be level screen

Hey Zijun, Boolean Values like True or False are supposed to be written in Upper-case without " " instead of "true" or "false" (they are not strings):

download

Try it that way and hopefully you’ll get what’s wrong.

Try to upload the picture here in your text editor, click and then select it from your PC.
Currently, it’s in your local storage and nobody can view it.

I think he means to capture a screenshot of your game (the level you are stuck in)

1 Like

ok I understand thank you.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.