[Adventurer] Fence Builder


#1

The level Fence Builder is ready for testing.

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


#2

completed level without issue

submitted LUA patch


#3

Thanks, Harry!

20characters


#4

what is the code for fence builder


#5

We don’t post solutions here.


#6

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


#7

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:


#8

OK Bryukh i will try


#9

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?


#10

@Hellenar I got one fence further:

fence_builder

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.


#11

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


#12

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