Level: Master of Names


#1

Our first true variable level. The main thing we’re wondering about this level is how well it fits into the progression. Namely, are you able to finish this level having only completed one level that introduces variables before this (Known Enemy)?


#2

My son did it without much trouble when he got to it yesterday.


#3

How did you beat the level because I am stuck on it for real it is hard for me.
Thank you,
George


#4

Hey George, what have you tried so far, and what’s going wrong?


#5

Nick, I have been using this code: but it doesn’t work.

enemy1 = self.findNearestEnemy()
self.attack(enemy1)
self.attack(enemy1)

enemy2 = self.findNearestEnemy()
self.attack(enemy2)
self.attack(enemy2)
self.attack(self.findNearestEnemy())


#6

What happens? Just basic, looks like you will kill two enemies and hit a third enemy once.


#7

What does that mean?
It is confusing.


#8

Are you still stuck on this level @MateenRaoufi? If so, what is your code so far so I can try to help.


#10

ok now i got it I won the level but now stuck on the final kithmaze level. Can you please help me on that on thank you dwhittaker


#11

I wonder what I’m missing. The system just won’t let me edit the code at this level, I only can add stuff from line 11. Aslo the suggestion is to “Use if?”, which isn’t available and hasn’t been taught yet anyway. Or does that simply mean that I should subscribe to get past this level?


#12

I agree that it isn’t letting you edit the default code (that seems to be new)

But I don’t see anything about “if”

# Your hero doesn't know these enemy's names!
# The glasses give you the findNearestEnemy ability.

enemy1 = self.findNearestEnemy()
self.attack(enemy1)
self.attack(enemy1)

enemy2 = self.findNearestEnemy()
self.attack(enemy2)
self.attack(enemy2)

I checked all languages, no “Use If” anywhere…

While I’m on the subject of the other languages for this level:

  1. Only Python has the default code as “Read Only” all the rest you can edit… (no idea why == no patch)

  2. I submitted a patch for clojure (the default code is using “self” but should be using “this”)

  3. Io is getting a “Line 5: Maximum call stack size exceeded” on the first attack enemy1 (checked on github can’t find anything related to such simple code having that error… @nick should I open one for this? all the levels I’ve checked bomb out on "enemy = " followed by “attack enemy”. ‘attack “Name”’ works fine.)


#13

Thanks for finding that Clojure issue; I’ve accepted the patch.

Io has many problems; the parser isn’t very complete. You can submit an issue to https://github.com/dariusf/iota, but we really need someone to take over active development on that parser.

Sample code should only be locked if you come into the level and the code is defaulted; if you change it afterward and reload, it shouldn’t be locked any more. Soon it’ll also only be locked if you are not much higher-level than expected for playing the level for the first time. Locking the sample code often really helps new players to not mess it up, which is why we do it in the first few levels, but we need to get smart about when not to do it, since it will frustrate more advanced attempts.


#14

my kids gave up on the entire game when this level didn’t allow them to edit the broken code. just a heads up. you’ll lose an entire audience with broken levels like this. It seems to be just busted in chrome. I was able to edit the code in firefox, then let them continue in chrome. For now, I’d recommend not using chrome since it doesn’t appear to be regularly tested in that browser.


#15

Sorry to hear that. If I may ask, what was the broken code? The sample code should be necessary, not broken.