Can't solve ogre-encampment [solved]

Can’t solve this level.

Error:
http://puu.sh/d99rt/bcd64c194a.png

Console output after pressing “Submit” button:
http://puu.sh/d99M4/5a3ccd41ff.png

My code:

loop
    enemy = @findNearestEnemy()
    if enemy
        @attack enemy
        @attack enemy
    else
        @attack "Chest"

Btw, everything on the screen looks good. How to solve it correctly?

Your code is fine, but there is a bug in our CoffeeScript transpilation process where it can’t handle nested if-statements instead loops like that. We’ll probably have our work cut out for us fixing it, too. For now I’d recommend playing the later levels in a language other than CoffeeScript, like Python.

Sorry about that!

1 Like

Thanks for answer, i switched to JavaScript and everything fine.