By Any Other Name Problem


#1

The new level: By Any Other Name, has no gems. Making it impossible to complete. Other than that, it is a good level.


#2

The point of the level is to change the variable names. If you don’t see any gems, it sounds like you haven’t changed the variable names.


#3

oops, I hadn’t changed them. Thanks :grinning:


#4

What does he serg mean by that??


#5

oh nevermind, i got it


#6

(Polish language) I can not do this PLEASE send me the code


#7

I have changed them and no gems appear

// Change the names of variables to make gems appear!
// Change the name of variable "enemy1" to "chunky".
var chunky = hero.findNearestEnemy();
hero.attack(chunky);
hero.attack(chunky);

// Change the name of variable "enemy2" to "monkey".
var monkey = hero.findNearestEnemy();
hero.attack(monkey);
hero.attack(monkey);

// Collect the gems after changing the variables.
hero.moveUp();
hero.moveRight();
hero.moveRight();

#8

It seems, that level stop to work correctly with python

# Change the name of variable "enemy1" to "chunky".
chunky = hero.findNearestEnemy()
hero.attack(chunky)
hero.attack(chunky)

# Change the name of variable "enemy2" to "monkey".
monkey = hero.findNearestEnemy()
hero.attack(monkey)
hero.attack(monkey)

# Collect the gems after changing the variables.
hero.moveUp()
hero.moveRight()
hero.moveRight()

I already passed it with this code, but now germs not appeared.


#9

Having the same issue with JavaScript.


#10

Same… idk how, i think its without ;


#11

Having the same problem (change variable names but no gems appear,) based on the discussion history it looks as though this is a recent bug. Does anyone know how to report it?


#12

Does not work with Javascript


#13

I’m using the Python mode, but perhaps this odd solution will also work for those using Javascript.

I figured that since the game has worked so well for so many people, and the problem just appeared today, it was more likely to be something trivial than a problem in the programming. Anyway, I decided to switch the hero from “Anya” to “Tharin.” That did the trick. Running the same code solution with Tharin caused the gems to appear and I was able to complete the level.

Curious to hear if this works for other people as well.

: )


#14

Hey actually, we just deployed a fix for the level! Not everyone will see it immediately, but, simply reloading the page should fix the issue.

If not, give it another day for our caches to clear, and then try again!

Sorry about that.


#15

This level isn’t working for me. I tried both reloading the page twice and switched from Tharin to Alejandro and back. It’s not a big deal, but it bugs me to see an “unfinished” flag in Kithgard when I’m in the mountains.


#16

Can you be a little more specific? What is not working as expected? Please post your code so we can check whether there is actually a bug.


#17

Working in JavaScript and this code worked fine for me:

[redacted]

I found it confusing and played with lots of different approaches before I got to solution. I don’t see the point of this exercise if I change a variable name in such an obtuse way.


#18

Please avoid posting solutions, that takes away the whole point of the game—several players will blindly use such solutions and end up not learning the concepts that the level was supposed to teach, only to find themselves stuck in a further level.

As for the purpose of the level, I believe it is to show that a variable’s name has no relation with its value—you can change the name of a variable to anything and it will still hold the value that you assigned to it.


#19

Here’s my code:

# Change the name of variable "enemy1" to "chunky".
chunky = hero.findNearest(hero.findEnemies())
hero.attack(chunky)

# Change the name of variable "enemy2" to "monkey".
monkey = hero.findNearest(hero.findEnemies())
hero.attack(monkey)

# Collect the gems after changing the variables.
hero.moveUp()
hero.moveRight()
hero.moveRight()

#20

@GundericusTheMighty Thanks, I managed to reproduce the problem. It seems that if you kill the enemies in a single strike, the gems will not appear. It looks like a bug, in my opinion. /cc @Bryukh @Serg

By the way, if you attack each enemy twice (even if they are already dead after the first strike), you should be able to pass.