# \[SOLVED\] I would like some help with Operation 'Killdeer'

**URL:** <https://discourse.codecombat.com/t/solved-i-would-like-some-help-with-operation-killdeer/25822>\
**Category:** Level Help\
**Created:** [December 3, 2020, 3:30pm UTC](https://discourse.codecombat.com/t/solved-i-would-like-some-help-with-operation-killdeer/25822 "2020-12-03T15:30:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noir1013](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/noir1013/32/17004_2.png) [@Noir1013](https://discourse.codecombat.com/u/Noir1013)\
**Post date:** [December 3, 2020, 3:30pm UTC](https://discourse.codecombat.com/t/solved-i-would-like-some-help-with-operation-killdeer/25822/1 "2020-12-03T15:30:58Z")

</div>

This is my code.

```python
# Lure the ogres into a trap. These ogres are careful.
# They will only follow if the hero is injured.

# This function checks the hero's health 
# and returns a Boolean value.
def shouldRun():
    if hero.health < hero.maxHealth / 2:
        return True
    else:
        return False
enemy = hero.findNearestEnemy()
run = shouldRun()
while True:
    # Move to the X only if shouldRun() returns True
    if run == True:
        hero.moveXY(75, 37)
    # Else, attack!
    else:
        hero.attack(enemy)

```

I’ve read multiple topics for this one. It just makes me even more confused and I cannot get Alejandro to stop standing in one place after he says “…but it’s dead.” after he kills an ogre.  
I’m stumped and I’ve no clue what to do.

---

<div class="post-metadata">

**Author:** ![milton.jinich](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/milton.jinich/32/21419_2.png) [@milton.jinich](https://discourse.codecombat.com/u/milton.jinich)\
**Post date:** [December 3, 2020, 3:31pm UTC](https://discourse.codecombat.com/t/solved-i-would-like-some-help-with-operation-killdeer/25822/2 "2020-12-03T15:31:27Z")

</div>

Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review [this topic](https://discourse.codecombat.com/t/welcome-to-codecombat-discourse-forums/15601), which shows all essentials of this board! Thanks!

---

<div class="post-metadata">

**Author:** ![Lydia\_Song](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lydia_song/32/31461_2.png) [@Lydia\_Song](https://discourse.codecombat.com/u/Lydia_Song)\
**Post date:** [December 3, 2020, 3:31pm UTC](https://discourse.codecombat.com/t/solved-i-would-like-some-help-with-operation-killdeer/25822/3 "2020-12-03T15:31:28Z")

</div>

Welcome‌ ‌welcome‌ ‌to‌ ‌the‌ ‌forum!‌ ‌It‌ ‌is‌ ‌a‌ ‌lovely‌ ‌place‌ ‌where‌ ‌you‌ ‌can‌ ‌share‌ ‌all‌ ‌kinds‌ ‌of‌ stuff‌ ‌(appropriate‌ ‌of‌ ‌course),‌ ‌share‌ ‌bugs,‌ ‌and‌ ‌even‌ ‌get‌ ‌assistance‌ ‌for‌ ‌code!‌ ‌We‌ ‌suggest‌ ‌that‌ ‌you‌ ‌review‌ ‌[this‌‌ topic](https://discourse.codecombat.com/t/welcome-to-codecombat-discourse-forums/15601%E2%80%8C)‌ ‌which‌ ‌shows‌ ‌all‌ ‌essentials‌ ‌of‌ ‌this‌ ‌board!‌ ‌And‌ ‌we‌ ‌suggest‌ ‌you‌ ‌review‌ [this topic](https://discourse.codecombat.com/t/essentials-how-to-post-format-your-code-correctly/15521)‌ ‌which‌ ‌shows‌ ‌how‌ ‌to‌ ‌post‌ ‌your‌ ‌code‌ ‌correctly!‌ ‌Thanks!!‌ ‌ 🥳 🥳

---

<div class="post-metadata">

**Author:** ![Lydia\_Song](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lydia_song/32/31461_2.png) [@Lydia\_Song](https://discourse.codecombat.com/u/Lydia_Song)\
**Post date:** [December 3, 2020, 3:34pm UTC](https://discourse.codecombat.com/t/solved-i-would-like-some-help-with-operation-killdeer/25822/4 "2020-12-03T15:34:05Z")

</div>

> [@Noir1013](#):
>
> `shouldRun`

Add parentheses to the end of this.

> [@Noir1013](#):
>
> ```python
> enemy = hero.findNearestEnemy()
> run = shouldRun
> 
> ```

Move this inside the while True loop.

Lydia

---

<div class="post-metadata">

**Author:** ![Noir1013](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/noir1013/32/17004_2.png) [@Noir1013](https://discourse.codecombat.com/u/Noir1013)\
**Post date:** [December 3, 2020, 3:36pm UTC](https://discourse.codecombat.com/t/solved-i-would-like-some-help-with-operation-killdeer/25822/5 "2020-12-03T15:36:40Z")

</div>

My forehead hurts from how hard I facepalmed…  
Thanks a million for helping me, Lydia!

---

<div class="post-metadata">

**Author:** ![Lydia\_Song](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lydia_song/32/31461_2.png) [@Lydia\_Song](https://discourse.codecombat.com/u/Lydia_Song)\
**Post date:** [December 3, 2020, 3:38pm UTC](https://discourse.codecombat.com/t/solved-i-would-like-some-help-with-operation-killdeer/25822/6 "2020-12-03T15:38:47Z")

</div>

No problem!  
Everyone makes mistakes!  
Lydia

---

<div class="post-metadata">

**Author:** ![ZAX155](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/zax155/32/34141_2.png) [@ZAX155](https://discourse.codecombat.com/u/ZAX155)\
**Post date:** [December 3, 2020, 4:08pm UTC](https://discourse.codecombat.com/t/solved-i-would-like-some-help-with-operation-killdeer/25822/7 "2020-12-03T16:08:24Z")

</div>

Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review [this topic](https://discourse.codecombat.com/t/welcome-to-codecombat-discourse-forums/15601), which shows all essentials of this board! Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/a/a9445509d1a758c41b5ddcddc8c8e20a5dedb67f.png) [@system](https://discourse.codecombat.com/u/system)\
**Post date:** [December 4, 2020, 4:08am UTC](https://discourse.codecombat.com/t/solved-i-would-like-some-help-with-operation-killdeer/25822/8 "2020-12-04T04:08:32Z")

</div>

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
