Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Help! Please. The Fine Mint


Hello there.

I’m playing CodeCombat, and I need help on a level that I can’t get past. I’m doing Python btw.

The Fine Mint. This is my code so far! I would be grateful for some help. Thanks!

I don’t get what that green highlight means! Please Help!


Your attackEnemy method might be the one causing the problem. I see that you have the variable Enemy declared globally which could be fine except that it only defines one enemy and never changes. Maybe put the variable inside the attackEnemy method.

Inside the while loop you call hero.attack(enemy) which is fine but its not the method you created above which would help you attack the enemy when called.

Id also like to add that you didnt have to consider this a bug. Typically any forum title with Help! in it will get attention.:smile:


In addition to Ty-Ler’s comments, the else statement in the attackEnemy function is superfluous. You already collect coins by calling the pickUpCoin function so you don’t need to include this there.

You create an attack function, but never call it. Also, if you include the definition of enemy in the attackEnemy function, your code can be very simple.

It looks like you have everything you need, you just need to straighten it up a bit. Attention to detail is essential.