# Nevermind it's solved

**URL:** <https://discourse.codecombat.com/t/nevermind-its-solved/21327>\
**Category:** Level Help\
**Created:** [May 1, 2020, 12:46pm UTC](https://discourse.codecombat.com/t/nevermind-its-solved/21327 "2020-05-01T12:46:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MellowBlox](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/mellowblox/32/12046_2.png) [@MellowBlox](https://discourse.codecombat.com/u/MellowBlox)\
**Post date:** [May 1, 2020, 12:46pm UTC](https://discourse.codecombat.com/t/nevermind-its-solved/21327/1 "2020-05-01T12:46:30Z")

</div>

I’m trying but it won’t attack the ogres.

```python
# In this level you will use functions with two parameters.
# Look at the structure below, notice how there are two arguments.
# These are both accessible within the function. 
enemy = hero.findNearestEnemy()
def checkAndAttack(x, y):
    # First move to the coordinates provided by the parameters.
    hero.move(x, y)
    if enemy:
        hero.attack(enemy)
    pass

checkAndAttack(24, 42)
checkAndAttack(27, 60)
# Navigate to the last 3 x-marks and defeat any remaining munchkins.
checkAndAttack(42, 50)
checkAndAttack(39, 24)
checkAndAttack(55, 29)

```

---

<div class="post-metadata">

**Author:** ![Deadpool198](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/deadpool198/32/16753_2.png) [@Deadpool198](https://discourse.codecombat.com/u/Deadpool198)\
**Post date:** [May 1, 2020, 1:43pm UTC](https://discourse.codecombat.com/t/nevermind-its-solved/21327/2 "2020-05-01T13:43:39Z")

</div>

Closed on May 1, 2020, 1:43pm UTC


