i have already solved this one now but thanks
can any body help me
Welcome to the forum. We’d be happy to help you!
Can you post your current code, and a bit of a description about what is/isn’t happening when you run it.
There’s instructions on how to format your code here.
this is my code
# The ‘target’ parameter is just a variable!
# It contains the argument when the function was called.
enemy = hero.findNearestEnemy()
topEnemy = hero.findNearestEnemy()
# Using the checkAndAttack function with the topEnemy variable.
# Move to the bottom X mark.
# Create a variable named bottomEnemy and find the nearest enemy.
bottomEnemy = hero.findNearestEnemy()
# Use the checkAndAttack function, and include the bottomEnemy variable.
Hi @Ritic-the-Cold, your code still isn’t formatted. Meaning it doesn’t show the indentation (how far the lines are pushed in). I can see a problem however:
At the top x you attacked the top enemy, now you’re at the bottom x you should attack the bottom enemy. (you’ve got a variable for that!).
It could be an indentation problem however so please put three ``` on two lines, then make a space inbetween them and post your code directly from codecombat. If you just post it from your post it still won’t be formatted.