Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

[SOLVED] Passing Through... Why does ma code nota work?

#1

Hi!
How do I solve Passing Through? Is my code okay?`while True:
item = hero.findNearestItem()
if item:
# If item.type IS NOT EQUAL TO “gem”
if item.type != “gem”:
# Then follow your pet wolf.
hero.moveXY(pet.pos.x, pet.pos.y)
else item and item.type == “gem”:
hero.moveXY("gem.pos.x, “gem”.pos.y)

        # Move to the gem's position.

https://codecombat.com/play/level/passing-through?

`

#2

Can you format properly please ?

#3

Wait, solved it!
Thanks for looking at my post… I’m new on this discourse…
any tips?
thnx again!

#4

Wait you solve the post or the level? If you are done the level write [SOLVED] in your title. Or if you think that you have correctly fix your post you can look at this tutorial [Essentials] How To Post/Format Your Code Correctly