The Final Kithmaze help


#21

Currently I have this issue while doing the Python version of CodeCombat and can’t get past the level. It says that i’m not using level than 10 statements in my code.

Here’s a picture: http://puu.sh/lQ7XM/74698bf15b.png


#22

##statements ≠ lines


Remove the :one:s from the brackets, because they count as separate statements.

Cheers


#23

Ah I see I didn’t know that was the case. Thank you very much! :smiley:


#24

your first response worked perfectly. I’m not sure what the significance of this is yet:

while (this.findNearestEnemy() !== null)
this.attack(this.findNearestEnemy());

I guess I’m just too new to the language.


#25

I cannot finish the level. I have done the right code based on all the comments and it doesn’t allow them to go through the door. I am using js.

Am I missing something?


#26

This level is still not working in js. Am I missing something


#27

Please include your code properly formatted inside of three backticks (`) before and after the code.


#28

Forgot to indent.
*This is Python.:wink:


#29

It comes up with a problem with the second code but the rest is all good


#31

Please remember to format your code according to the FAQ. As I have explained at various times to other users, it helps us understand the code a little easier. Thanks!

(If you find this helpful, please :heart: this post)


#32

Thanks Dude! Helped me so much!!!


#33

Here’s my code
while True:
hero.moveRight()
hero.moveUp()
hero.moveRight()
enemy = hero.findNearestEnemy()
hero.attack(enemy)
hero.attack(enemy)
hero.moveDown(2)
hero.moveUp(1)


#34

Please format your code according to the FAQ. It helps understand your code better. It basically helps us help you! :smile:

Also, could you give some information on what is going wrong, what the game is saying etc.

Cheers! :beers:

(Please :heart: this post if it helps!)


#35

sorry I replied so late guys


#36

[redacted, please don’t post solutions]

I used this and it worked


#37

won’t work… I have to use hero.move instead of self.move


#38

You are the best thanks for the help


#39

It worked thanks!!!


#40

Hey. I am doing LUA and I can’t get pass this level.


#41

I’ve been trying to figure out how to do this for like 10 minutes, and I can’t seem to figure out how. I’m using Javascript. Here’s my code:

var enemy = hero.findNearestEnemy();

while (true) {
     hero.moveRight();
     hero.moveUp();
     hero.moveRight();
     hero.moveDown(2);
     hero.moveUp();
     hero.enemy;
     hero.attack(enemy);
     hero.attack(enemy);
}

I’ve tried sticking this part in all the different spots I can think of, but it always runs the code early, and it says that there isn’t an enemy in my line of sight.

     hero.enemy;
     hero.attack(enemy);
     hero.attack(enemy);

Am I doing something wrong, or is the game bugging out?