New Level: Copper Meadows

Check out Copper Meadows! This is the level directly after coinucopia in which players write their own flag handlers for the first time. Where Coinucopia is intended to introduce players to the “press submit and play the game” mechanic, Copper Meadows is when players get their first opportunity to write functional flag AI. As such, we’re especially interested in the relative difficulty here. We’re hoping that players will have at least glanced at the code structure of Coinucopia and be able to dig around figure this out. Was that your experience, or was it too big a leap?

4 Likes

I found it to be quite a leap but I’m trying to figure it out anyway.

1 Like

Ok, this is very confusing and I’m not sure, but I think the syntax is incorrect in the JavaScript version. You start with this code:

// Collect all the coins in each meadow.
// Use flags to move between meadows.
// Press Submit when you are ready to place flags.

loop {
    flag = this.findFlag();
    if (flag) {
        // Pick up the flag.
        
    } else {
        // Automatically move to the nearest item you see.
        item = this.findNearestItem();
        if (item) {
            position = item.pos;
            x = position.x;
            y = position.y;
            this.moveXY(x, y);
        }
    }
}

Shouldn’t it be

var flag = this.findFlag();

I think that would be the case for the rest of the code too. It says there is an error at line 17. Also, the code in the previous level is this:

loop {
var flag = this.findFlag();
if (flag) {
    this.pickUpFlag(flag);
}
else {
    this.say("Place a flag for me to go to.");
} 
}

Again, I’m just learning but this doesn’t seem to work when placed in the Copper Meadows level. Also the samples use green, purple, and black. Each of the previous lessons take the time to explain a principle. This throws you in the deep end without any idea what you’re supposed to do.

1 Like

Figured it out! The problem was indeed the fact that the syntax is wrong for the JavaScript version. The var is missing as noted above.

1 Like

Oops, just totally Pythoned out there! Thanks for catching that. I’ve updated the sample code for that and the following levels, all of which were missing the var. Let me know if you spot any more I missed.

2 Likes

Guys i am on python and i don’t know the code can someone give it to me i will be very happy.

Here is my code:

 
loop:
    flag = self.findFlag()
    if flag:
        # Pick up the flag.
        self.pickUpFlag(flag)
    else:
        # Automatically move to the nearest item you see.
        item = self.findNearestItem()
        if item:
            position = item.pos
            x = position.x
            y = position.y
            self.moveXY(x, y)
        else:
            self.say("Place a flag for me to go to.")
1 Like

@diy73

It says this

can someone give me a code? i will check my code lots of times and see whats wrong so i dont get it wrong next time. pelase dont give hints i will get more confused. just give me the code and then i will check the problem i had, thanksssss

Do you equip the WOODEN GLASSES?

Easiest code ;p all you need to do is place the flags quickly before the timer runs out lololol i copied from last level haha! :
dont forget to hit sumbit!

# Press Submit when you are ready to place flags.
loop:
    flag = self.findFlag()
    if flag:
        self.pickUpFlag(flag)
    else:
        self.say("Place a flag for me to go to.")

epic skills lolololololololololololololololo

2 Likes
loop:
    flag = self.findFlag()
    if flag:
        self.pickUpFlag(flag)
    else:
        # Automatically move to the nearest item you see.
        item = self.findNearestItem()
        if item:
            position = item.pos
            x = position.x
            y = position.y
            self.moveXY(x, y)

Only use my code if you can’t figure it out on your own.

1 Like

Yes, but that code takes more work in actual live execution. You can make it pick up coins automatically with only a few lines, and save yourself a whole ton of mouse clicking work. Save your mouse clicking for putting down a few flags for your char to move from level to level.

Your code is valid, though :stuck_out_tongue: It is more work, however!

1 Like

I had a similar problem with this stage, but it was the same stupid problem I always have - The code is fine, but I don’t have the right equipment enabled. For some reason the XY boots were not enabled.

Hi all, seems I’ve got a bug in this level.
Game engine doesn`t give me any flag to use it :frowning:
In previos level I’ve got flag and all worked fine, but not in Cooper Meadows
My hero have both glasses and flag equiped

I’m using Ubuntu 14 and got this bug in both Google Chrome and Mozilla Firefox brousers.
Here is screenshot.

2 Likes

Press the green Submit button and you get the possibility to place flags yourself.

They are present in the bottom left corner as soon as you pressed submit.

2 Likes

so easy I can’t think anybody will fail

2 Likes

i cant run fast enough

1 Like

You should have enough time if you are using some of the previously mentioned code that has both if flag: and if item. Everyone who is using moveXY should probably have the softened leather boots too. They are only 100 gems Last tip would be to only use your flag to get near the area and then let your if item: code take over ( that’s twice as important when enemies are near)

2 Likes

Thanks you helped me alot :smile:

2 Likes
while True:
    flag = hero.findFlag()
    if flag:
        pass  # `pass` is a placeholder, it has no effect.
        # Pick up the flag.
        greenFalg = hero.findFlag("green")
    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)

what should i do?

1 Like