Level: Woodland Cleaver


#21

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


#22

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


#23

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.


#24

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


#25

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


#26

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:


#27

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


#28

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


#29

Nah,

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


#30

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


#31

Do you have indentations on your code in the game?


#32

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


#33

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


#34

Welcome, anytime :grinning:


#35

@Newmany, currently, before the:

if self.isReady("cleave")

You need:

if self.distanceTo(enemy) < 5:
 or 

if self.distanceTo(enemy) < 15:


#36

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


#37

welcome, anytime :grinning:


#38

@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:


#39

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


#40

Cool! I have finally finished the level <3