# How to beat logical path

Properly formatted, per this topic, please:
[Essentials] How To Post/Format Your Code Correctly

I donβt have one here is the code it gives you# Get two secret true/false values from the wizard.

# Check the guide for notes on how to write logical expressions.

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)

# If EITHER secretA or secretB is true, take the high path.

hero.moveXY(38, 24)

# If secretB is NOT true, take the high path.

hero.moveXY(50, 24)

I will let @dedreous to help you because I have to go to bed. Bye!

Ok, please read the topic I just sent you. It will be crucial, if not required, should you need help in future levels.

Here is how your last post should look:

I donβt have one here is the code it gives you# Get two secret true/false values from the wizard.

``````# Get two secret true/false values from the wizard.
# Check the guide for notes on how to write logical expressions.
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.

hero.moveXY(38, 24)
# If secretB is NOT true, take the high path.

hero.moveXY(50, 24)
``````

oh ok thanks

So, with that being said, the concept this lesson covers is the use of logical operatorsβ¦and, or, not.

The idea is to use if statements to test if a certain condition is true and then move according the result of that test.

1 Like

ok can I have the soulotion

No, that is not what this forum is here for. We are here to help, guide and even further teach coding techniques. As per the Welcome topic at the top of the forum, posting solutions is not allowed:

• You may not post solutions. It is strongly against the rule and might result in a mute or ban.
2 Likes

OK SORRY I think I got an answer

I only seeβ¦ one if statement.

Of course, that is the βRestartβ codeβ¦what you get when you first visit the level, or restart it.