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

Reading Rumble Bug

In Reading Rumble(Cloudrip Mountains), there’s one ogre whose name has an apostrophe(Grul’Thock). I don’t think there’s supposed to be an apostrophe. Here’s my code if it helps:

// Defeat all incoming ogres. while(true) {
// Find the nearest enemy.
var enemy = hero.findNearest(hero.findEnemies());
// If there is an enemy, and it is a “brawler”:
if(enemy) {
if(enemy.type == “brawler”) {
// Then say its name (.id) in UPPERCASE.
var id = enemy.id.toUpperCase();
hero.say(id);
}
// For other enemies, just fight.
else {
while(enemy.health >= 0) {
hero.attack(enemy);
}
}
}
}

Thank you.

Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review this topic, which shows all essentials of this board! Thanks!

Sorry, I can’t help you right now, I must go eat lunch!

Try having the variable id stored as only the enemy’s id. Then, create a new variable and use id.toUpperCase(). Then say that variable.

id = friend.id
e = id.toUpperCase()
hero.say(e)

That would say a friend’s id. You would need to say the enemy’s id.

I tried this out, but the wizards still don’t hear me say GRUL’THOCK. Should the apostrophe be in the name?

Else just attack an enemy.

Hi, I will not be able to help, because I am not a subscriber yet, but It would help all of us if you would format your code using the </> buttons above your writing space. Thanks! It goes from this:

Hero.say(„Hello“)

To this:

hero.say(„hello“)

My code correctly formatted:

// Defeat all incoming ogres. while(true) {
// Find the nearest enemy.
var enemy = hero.findNearest(hero.findEnemies());
// If there is an enemy, and it is a “brawler”:
if(enemy) {
if(enemy.type == “brawler”) {
// Then say its name (.id) in UPPERCASE.
var id = enemy.id.toUpperCase();
hero.say(id);
}
// For other enemies, just fight.
else {
while(enemy.health >= 0) {
hero.attack(enemy);
}
}
}
}

This is probably the only thing I can do, but try to put the while true loop one like down

You should also Indent your code properly.

Hi Ozakesus87,

Your code works when I try it. Have you tried resubmitting it, so you get a different seed?

Jenny

The ogre named GRUL’THOCK is gone now, but even though my hero says the name properly, the wizards still don’t attack the ogre.

1 Like

Um, that’s odd. Can you try it in a different browser, or on a different device?

It turns out that my hero wasn’t close enough to the wizards for them to hear, so I had to move closer to them. I solved the level now; thanks for the help

1 Like

Good job! :partying_face: :partying_face: