Please post your code, with radiant harmonious formatting, as described in the FAQ.
My code so far is
self.moveXY(23, 23)
loop:
self.findNearestEnemy()
if self.isReady(“cleave”)
else:
enemy = self.findNearestEnemy()
self.attack(enemy)
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.
Where to I find the FAQ? And what is it?
What clan are you? I totally want to join. You are the only one who will reply to a person like me.
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!
Thanks heaps. I’ll ask you if I need help.
P.S. Do you live in NZ like I do?
Or are you up in the middle of the night replying. If you are don’t go to any trouble.
Nah,
Regarding your code, do you have indentations on it in the game? And what programming language are you using?
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
Do you have indentations on your code in the game?
Got it off my friend and coding has always been a dream job for me
Got to go it is break time for me at school. Thanks for the help.
Welcome, anytime
@Newmany, currently, before the:
if self.isReady("cleave")
You need:
if self.distanceTo(enemy) < 5:
or
if self.distanceTo(enemy) < 15:
Cool. Thanks heaps. I’ll try it. So tired. Up at 2 am. Doing homework
welcome, anytime
@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
Also,
Your code:
if self.isReady("cleave")
else:
Would turn into:
if self.isReady("cleave"):
self.cleave(enemy)
else:
Please this post if it helps
Cool! I have finally finished the level <3