If your code comes to a hang-up restart the level from the URL bar with another language:
https://codecombat.com/play/level/sarven-treasure?codeLanguage=javascript
is there any possibility to debug my code? do it in the browser Web Console
for quick debug message use
pet.debug("debug message")
never hero.say(“talking takes time”)
The distance between two objects can be found using Vector library:
enemyDistToNextPorter < coinDistToNextPorter # same as
enemy.pos.distance(porter.pos) < coin.pos.distance(porter.pos)
Officially you need Programmatication V but you don’t really have to own any book to use the language possibilities. How to see what is available?
Go to some Leader Board and find a person with that book:
select 7 GodieBoy watch
Go to Vector

and then
See Listen well, brothers and sisters, for I can teach you the power of the VECTOR (Nope, not the guy from Despicable Me…)
I think this isn’t the place for a programmer to learn Python because all code is “translated” to java script. You can teach your son python if he likes it more and write your code in java script ( it’s closer to C, C#) and you will need only to format it the python way.
For example see from same leader board

You can safely use all of them in python code. The corresponding python table is so limited maybe
not to confuse the python learners:

And so on…
I think your code is slow because Code Combat strongly dislikes the nested loops…