Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Endangered burl Level Help

Hello I cannot get the code for endangered burl.Please share the code

We do not share code solutions here. It does not help you learn coding, which is what this program is for. We are welcome to help you though, if you share your code that is. Maybe you should also share your issue

3 Likes

We can only help if we c ur code.

1 Like

Also, try reading the hints. They can help a lot!

1 Like

@Shasini_Amarnath Asking for the code can either get you suspended or banned as it is against the rules.

1 Like

Just asking for code wouldn’t make that happen. That would be very harsh. Just because it’s against the rules, does not mean that immediately happens. It never has before.
@Shasini_Amarnath please do post your code, so we can see the problem with it.

1 Like

This the code but is not attacking

while(true) {
var enemy = hero.findNearestEnemy();
if (enemy.type == “burl”) {
hero.say(“I’m not attacking that Burl!”);
}
if (enemy.type == “munchkin”) {
hero.attack(enemy);
}
if (enemy.type == “thrower”) {
hero.attack(enemy);
}
if (enemy.type == “orge”) {
hero.moveXY(22, 47);

This should be “ogre”.

Also, because you did not format it (which is okay for now, but please try to do so in the future) I want to remind you to check your indents

1 Like

Is this one correct
while True:
enemy = hero.findNearestEnemy()
if enemy.type==“burl”:
if enemy.type==“munchkin”:
hero.attack(enemy)
if enemy.type==“thrower”:
hero.attack(enemy)
if enemy.type==“ogre”:

Ummm, i guess so. Does it work???

I’m confused, are you using python or javascript? Are both of those codes yours? You seem to have changed a lot more that just “orge” to “ogre”. That was the only change I recommended. Please could you clarify what’s yours and what you have tried so far in this level.

2 Likes

Could you like, use mostly one language for the questions? It’s hard to keep up with you when you’re switching languages all of a sudden

1 Like

This is very confusing.
For the first code you wrote in javascript, but now your coding in python? Please try to use one language so we can understand better and help you!

1 Like

I am using python and both of the codes tried it is not working.

Close the topic I got the code