# The Agrippa Defense (need help)

**URL:** <https://discourse.codecombat.com/t/the-agrippa-defense-need-help/6678>\
**Category:** Solved\
**Created:** [February 4, 2016, 1:55am UTC](https://discourse.codecombat.com/t/the-agrippa-defense-need-help/6678 "2016-02-04T01:55:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![coderunicorn](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@coderunicorn](https://discourse.codecombat.com/u/coderunicorn)\
**Post date:** [February 4, 2016, 1:55am UTC](https://discourse.codecombat.com/t/the-agrippa-defense-need-help/6678/1 "2016-02-04T01:55:53Z")

</div>

I’ve been trying to figure this out for a while now because I only kill the first two groups and not the second please help.  
Here is my code:

loop:  
enemy = self.findNearestEnemy()

```
if enemy:
    a = self.distanceTo(enemy)
    if a < 5: 
        self.isReady("cleave")
        self.cleave(enemy)
    else:
            self.attack(enemy)
```

---

<div class="post-metadata">

**Author:** ![AdrianCgw](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@AdrianCgw](https://discourse.codecombat.com/u/AdrianCgw)\
**Post date:** [February 4, 2016, 3:16am UTC](https://discourse.codecombat.com/t/the-agrippa-defense-need-help/6678/2 "2016-02-04T03:16:32Z")

</div>

You must test if your cleave is ready:

```python
if self.isReady("cleave"):
    self.cleave(enemy)

```

---

<div class="post-metadata">

**Author:** ![coderunicorn](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@coderunicorn](https://discourse.codecombat.com/u/coderunicorn)\
**Post date:** [February 4, 2016, 9:07pm UTC](https://discourse.codecombat.com/t/the-agrippa-defense-need-help/6678/3 "2016-02-04T21:07:34Z")

</div>

Oh, Thanks that helped.
