i need help
please show code, @calvin . also,
Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review this topic, which shows all essentials of this board! Thanks!
Calvin’s not new.
20 characters
Collect all the coins in each meadow.
Use flags to move between meadows.
Press Submit when you are ready to place flags.
while True:
flag = hero.findFlag()
if flag:
pass # pass
is a placeholder, it has no effect.
# Pick up the flag.
else:
# Automatically move to the nearest item you see.
item = hero.findNearestItem()
if item:
position = item.pos
x = position.x
y = position.y
hero.moveXY(x, y)
hero.findNearestFlag, not hero.findFlag
please format your code.
hi eric
to pick up flag hero.pickUpFlag
ok now what
Yep thats all you need to do add hero.pickUpFlag(flag)
is that all???
solution me. Thx! 20
it didnt work :(((((((((((((
then why did you mark a solution?
he said to do it
yeah but just cuz he did doesnt mean you have to
only use the solutions if you have passed the level and the post that helped the most worked
That’s what I meant, should have clarified. Sorry.
and you need to put down flags. in submit
Did you use the flags to move around to different areas of the level? If not, then you need to do that to complete the level.
# Collect all the coins in each meadow.
# Use flags to move between meadows.
# Press Submit when you are ready to place flags.
while True:
flag = hero.findNearestFlag
if flag:
pass # `pass` is a placeholder, it has no effect.
# Pick up the flag.
hero.pickUpFlag(flag)
else:
# Automatically move to the nearest item you see.
item = hero.findNearestItem()
if item:
position = item.pos
x = position.x
y = position.y
hero.moveXY(x, y)