Sarven road help


#1

I am having trouble with sarven road could some one give me the code I am using python but i can switch to other users to.


#2

We don’t give out correct code as a regular policy here at CodeCombat. This is meant to teach you coding; you can’t learn if you get the solution from somewhere else.

What part are you having trouble with? Is there an error? If so, what does it say? Post the code you have so far and give us further information.


#3

loop:
self.findNearestEnemy()

if enemy:
self.attack(enemy)
self.isReady(“cleave”)
self.cleave(enemy)
else:
self.moveXY(56, 61)


#4

You need to format your code. See the FAQ (and control K I believe).

self.isReady(“cleave”) returns a boolean answer - either True or False. That line would generate an error as the code is not expecting a boolean answer.

It is good when testing whether the “cleave” ability is ready. Don’t trigger a cleave unless it is ready…

if enemy:
    if self.isReady("cleave"):
        self.cleave(enemy)
    else:
        self.attack(enemy)

#5

I fixed it no need for help but thanks