Mountain level Echo of War is ready for testing.
Implement the function to search a letter in a word and clean up the scrap-heap of old robots.
Mountain level Echo of War is ready for testing.
Implement the function to search a letter in a word and clean up the scrap-heap of old robots.
I didn’t encounter problems in completing this level. I used my Twilight Glasses (infinity range).
It shouldn’t affect on this level, because all enemies in the visible area.
This is a frustrating level for me. In python the function should just be:
return letter in word
But this doesn’t work. Need to fix this so people can learn real python!
And in JS you can use indexOf
Our goal to explain classic CS concepts and problems. Of course you can just use built-in tools, but if you understand their mechanic (at least in common) you can be better in development.
OK, I didn’t know if it matters or not, I just thought to mention it in case someone fails with another glasses. I did this one after Ice Hunter, so I was still a bit traumatized
@Bryukh Just finished the level with the default gear I had at that time, no issues.
Wonderful level @Bryukh, thanks!
Hi, Guys!
Can not complete this level. Always die from explose. Here is my code:
* 1. def isLetterInWord(word, letter):
* 2. for index in range(len(word)):
* 3. if word[index] == letter:
* 4. return True
* 5. return False
* 6. engineer = hero.findFriends()[0]
* 7. safeLetter = engineer.safeLetter
* 8. enemies = hero.findEnemies()
* 9. for index in range(len(enemies)):
* 10. enemy = enemies[index]
* 11. if isLetterInWord(enemy.id, safeLetter):
* 12. while enemy.health>0:
* 13. hero.attack(enemy)