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

[SOLVED]I need help on copper meadows

i need help

1 Like

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!

1 Like

Calvin’s not new.
20 characters

1 Like

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)
1 Like

hero.findNearestFlag, not hero.findFlag

1 Like

please format your code.

1 Like

hi eric

1 Like

to pick up flag hero.pickUpFlag

1 Like

ok now what :expressionless:

1 Like

Yep thats all you need to do add hero.pickUpFlag(flag)

2 Likes

is that all???

:neutral_face:

1 Like

solution me. Thx! 20

1 Like

it didnt work :(((((((((((((

1 Like

then why did you mark a solution?

he said to do it :expressionless:

1 Like

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.

2 Likes

and you need to put down flags. in submit

2 Likes

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.

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

1 Like