Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

LogicaI Path Help


#1

i need help with the level i try the things its telling me to do i even tried just to tell him to move to the spots that are safe without and special code and i cant complete it PLEASE HELP


#2

Yep, just wait a minute.
And in the future can you post your code onto the discourse (formatted as it says in the https://discourse.codecombat.com/faq.
I’ll be with you in a minute.
:lion: :lion: :lion:


#3

my codes in the picture


#4

Yes but I can’t copy and paste it when it’s on the picture.
Why aren’t you doing it like the levels says, you’ve got rid of the code the level gave you. Show me your code using that stuff.
:lion: :lion: :lion:


#5

ok and i got rid of the code cause i like taking the easy routes


#6

Blockquote

hero.moveXY(14, 24)
hero.moveXY(20, 15)
hero.moveXY(26, 24)
hero.moveXY(32, 33)
hero.moveXY(38, 24)
hero.moveXY(44, 15)
hero.moveXY(50, 24)

Blockquote


#7

But it won’t work if you don’t use the secrets.
:lion:


#8

did i do that right or no


#9

ok well i need help with the secrets


#10

Let me post the original code:

# 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)

For this section:

# If Either a or b is true, take the high path

There are different connectives you can use in coding, the biggest ones are “and” and “or”.
Which one do you think you’ll need here?
:lion:


#11

Because the level is constantly changing, it forces you to use variables. Using moveXY commands won’t work. Follow the directions in the default code when you first open the level.


#12

I believe its or. Yeah


#13

If you haven’t already, look at the Hints, they explain what you’re having trouble with logical expressions, it also explains the last connective used in the level “not”, as in:

if not enemy:
   hero.say("where are they")

:lion:


#14

ok…that totally makes sense…


#15

Are you being sarcastic?
You better not be.
To be perfectly honest, it’s not that hard.
How long have you really been trying to do this level for?
Don’t ask for a solution unless you haven’t been able to do a level, for at least a week.
:lion: :lion: :lion:


#16

ok sorry i just cant go on at all XD. this level is one of the few that causes trouble for me


[Adventurer] Twisted Canyon