Помощь с возвратом в ферму Thornbusch

# Функция `maybeBuildTrap` определяет два параметра!
def maybeBuildTrap(x, y):
    # Используй координаты `x` и `y` для передвижения.
    hero.moveXY(x, y)
    enemy = hero.findNearestEnemy()
    if enemy:
        pass
        # Используй `buildXY` для постройки огненной ловушки в нужных координатах.
        hero.buildXY("fire-trap" , 43, 50)
while True:
    # Здесь вызывается `maybeBuildTrap` с координатами верхнего входа.
    maybeBuildTrap(43, 50)
    # Теперь вызови `maybeBuildTrap` для левого входа.
hero.buildXY("fire-trap" , 25, 34)
    # Теперь вызови `maybeBuildTrap` для нижнего входа.
hero.buildXY("fire-trap" , 43, 20)

Не получается ,в чем проблема?

you need to use maybeBuildTrap() inside the while loop. Don’t use any hero.buildXY in the while loop. in the def, instead of using a specific number, use x,yinside the hero.buildXY. Please let me know if this sounds confusing.

You are supposed to put hero.buildXY("fire-trap", x, y) instead of x and y coardinates. Yoy use x and y because in the finction the (x, y)is the placeholder. So you would put maybeBuildTrap(the x position here, the y position here)

# Функция `maybeBuildTrap` определяет два параметра!
def maybeBuildTrap(x, y):
    # Используй координаты `x` и `y` для передвижения.
    hero.moveXY(x, y)
    enemy = hero.findNearestEnemy()
    if enemy:
        pass
        # Используй `buildXY` для постройки огненной ловушки в нужныхкоордината
    hero.buildXY("fire-trap" , 43, 50)
while True:
    # Здесь вызывается `maybeBuildTrap` с координатами верхнего входа.
    maybeBuildTrap(43, 50)
    # Теперь вызови `maybeBuildTrap` для левого входа.
maybeBuildTrap("fire-trap" , 25, 34)
# Теперь вызови `maybeBuildTrap` для нижнего входа.
maybeBuildTrap("fire-trap" , 43, 20)

Все равно не получается

You are supposed to put hero.buildXY("fire-trap", x, y) instead of x and y coardinates. Yoy use x and y because in the finction the (x, y) is the placeholder. So you would put maybeBuildTrap(the x position here, the y position here)

то есть не писать числа в координатах x и у? просто написать x и y ?

Yes and use the function

With maybeBuildTrap(the x position here, the y position here)

# Функция `maybeBuildTrap` определяет два параметра!
def maybeBuildTrap(x, y):
    # Используй координаты `x` и `y` для передвижения.
    hero.moveXY(x, y)
    enemy = hero.findNearestEnemy()
    if enemy:
        pass
        # Используй `buildXY` для постройки огненной ловушки в нужныхкоордината
    hero.buildXY("fire-trap" , 43, 50)
while True:
    # Здесь вызывается `maybeBuildTrap` с координатами верхнего входа.
    maybeBuildTrap("fire-trap", x , y)
    # Теперь вызови `maybeBuildTrap` для левого входа.
maybeBuildTrap("fire-trap" , x, y)
# Теперь вызови `maybeBuildTrap` для нижнего входа.
maybeBuildTrap("fire-trap" , x, y)

Put in x, y in the function, and put the coardinates where it is giving you an error

delete that hero.move
in the buildxy firetrap where you say 43 58 in the function replace it with x y

Я не понимаю…

don’t include"fire-trap" inside the while loop.

Уже лучше, но у меня погибает крестьянин,который прибегает сверху

Maybe it is just a bad seed. Try to submit it again. Your code is correct so it might just be a bad seed

# Функция `maybeBuildTrap` определяет два параметра!
def maybeBuildTrap(x, y):
    # Используй координаты `x` и `y` для передвижения.
    enemy = hero.findNearestEnemy()
    if enemy:
        pass
        # Используй `buildXY` для постройки огненной ловушки в нужных координатах.
        hero.buildXY("fire-trap", x, y)
        
while True:
    # Здесь вызывается `maybeBuildTrap` с координатами верхнего входа.
    maybeBuildTrap(43, 50)
    # Теперь вызови `maybeBuildTrap` для левого входа.
    maybeBuildTrap(25, 34)
    # Теперь вызови `maybeBuildTrap` для нижнего входа.
    maybeBuildTrap(43, 20)

он второй раз возвращается на верх для установки огненной ловушки

Я не знаю, что случилось. Ваш код правильный, так что это может быть ошибка

Благодарю за совет!!!

без проблем! Я рад помочь в любое время @Pablo