Level: Woodland Cleaver

Please post your code, with radiant harmonious formatting, as described in the FAQ.

2 Likes

My code so far is
self.moveXY(23, 23)
loop:
self.findNearestEnemy()
if self.isReady(“cleave”)
else:
enemy = self.findNearestEnemy()
self.attack(enemy)

2 Likes

Please read the FAQ so that you can format your code properly, currently, your indentations are missing after the loop, the else. The statements after:
enemy = self.findNearestEnemy()
need to be indented.

2 Likes

Where to I find the FAQ? And what is it?

2 Likes

What clan are you? I totally want to join. You are the only one who will reply to a person like me.

2 Likes

Next to your profile picture, there are 3 lines, click on it and you will see categories like Bugs and Adventurer, below you`ll find the words, FAQ, click on it, and scroll down to Post your code with radiant, harmonious formattingbut it be easier to go to the website http://discourse.codecombat.com/faq

I do not have a clan yet, but I will soon, I` d love for you to join! :smile: :smile:

2 Likes

Thanks heaps. I’ll ask you if I need help. :relieved:
P.S. Do you live in NZ like I do?

2 Likes

Or are you up in the middle of the night replying. If you are don’t go to any trouble.

2 Likes

Nah,

Regarding your code, do you have indentations on it in the game? And what programming language are you using?

2 Likes

I am using Python. I am using it for my genius hour. If you don’t know what it is watch this video. https://www.youtube.com/watch?v=FEQzKH7v0-Q

3 Likes

Do you have indentations on your code in the game?

2 Likes

Got it off my friend and coding has always been a dream job for me

2 Likes

Got to go it is break time for me at school. Thanks for the help.

2 Likes

Welcome, anytime :grinning:

1 Like

@Newmany, currently, before the:

if self.isReady("cleave")

You need:

if self.distanceTo(enemy) < 5:
 or 

if self.distanceTo(enemy) < 15:

1 Like

Cool. Thanks heaps. I’ll try it. So tired. Up at 2 am. Doing homework :sleeping:

1 Like

welcome, anytime :grinning:

1 Like

@Newmany, If you`re still wondering about how to format your code according to the FAQ,
Here is an example:

Your code:

self.moveXY(23, 23)
loop:
self.findNearestEnemy()
if self.isReady(“cleave”)
else:
enemy = self.findNearestEnemy()
self.attack(enemy)

You would put triple backticks around your code so that it becomes this:

self.moveXY(23, 23)
loop: 
   self.findNearestEnemy() 
   if self.isReady("cleave") 
   else: 
      enemy = self.findNearestEnemy() 
      self.attack(enemy)

Cheers :beers:

1 Like

Also,

Your code:

if self.isReady("cleave")
else:

Would turn into:

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

Please :heart: this post if it helps

6 Likes

Cool! I have finally finished the level <3

3 Likes