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

[Adventurer] Fence Builder

The level Fence Builder is ready for testing.

It’s Mountain level from Geometry series. Do you know how to build a fence?

1 Like

completed level without issue

submitted LUA patch

Thanks, Harry!


what is the code for fence builder

We don’t post solutions here.

really we don’t post them then how am i supposed to do my codecombat i am about to finish the game i am in the ??? world

I’m not sure that I understood you. I suppose you forgot some punctuation marks.

You can read instructions and solve this level. Also, you can ask advice (not a solution). It’s possible to complete games without cheat codes and walkthroughs :slight_smile:

OK Bryukh i will try

I’m stuck on this level. This is the code that got me the farthest:

# Build a fence around the farm.

# Take coordinates of the opposite corners.
customer = hero.findNearest(hero.findFriends())
x1 = customer.leftBottom.x
y1 = customer.leftBottom.y
x2 = customer.rightTop.x
y2 = customer.rightTop.y
step = 4

# Let's build the bottom side.
for x in range(x1 + step, x2 + 1, step):
    hero.buildXY("fence", x, y1)
# Then the right side.
for y in range(y1 + step, y2 + 1, step):
    hero.buildXY("fence", x2, y)
# Build the top side.
for x in range(x1 + step, x2 -1, step):
    hero.buildXY("fence", x, y2)
# Build the left side.
for y in range(y1 + step, y2 - 1, step):
    hero.buildXY("fence", x1, y)

With this code my player builds the whole fence except for the top and bottom left corners.

Can someone tell me what I’m doing wrong?

1 Like

@Hellenar I got one fence further:


The third fence needs a negative step. I think the fourth does too, because my hero is starting it from the bottom, but when I put that in, she doesn’t build the fourth wall at all.

I’m not really wrapping my head around the logic of the level, but, alas, I seem able to hack away at it until I guess the right answer.

1 Like

maybe u can use move xy but my hero is not moving

Is there a way to make a hero not get stuck between fences? I just tried, and I suppose it was a bad seed.

1 Like