# Noble sacrifice/ python/ Bonus help \[Solved\]

**URL:** <https://discourse.codecombat.com/t/noble-sacrifice-python-bonus-help-solved/27950>\
**Category:** Level Help\
**Created:** [March 15, 2021, 2:19pm UTC](https://discourse.codecombat.com/t/noble-sacrifice-python-bonus-help-solved/27950 "2021-03-15T14:19:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Some\_Guy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/some_guy/32/20317_2.png) [@Some\_Guy](https://discourse.codecombat.com/u/Some_Guy)\
**Post date:** [March 15, 2021, 2:19pm UTC](https://discourse.codecombat.com/t/noble-sacrifice-python-bonus-help-solved/27950/1 "2021-03-15T14:19:44Z")

</div>

I am trying to get the bonus for level “Noble Sacrifice” and my soldiers keep attacking the yeti when it kills one of them

```python
 Collect 80 gold
while hero.gold <= 80:
    item = hero.findNearestItem()
    hero.move(item.pos)
# Build 4 soldiers to use as bait
while hero.gold >= hero.costOf("soldier"):
    hero.summon("soldier")
# Send your soldiers into position
points = []
points[3] = { "x": 13, "y": 73 }
points[2] = { "x": 51, "y": 73 }
points[1] = { "x": 51, "y": 53 }
points[0] = { "x": 90, "y": 52 }

while True:
    friends = hero.findFriends()
    for j in range(len(friends)):
        point = points[j]
        friend = friends[j]
        enemy = friend.findNearestEnemy()
        hero.command(friend, "move", point)

# Use range to make an array to loop over.
# Match the friends to the points and command them to move

```

---

<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:** [March 15, 2021, 2:20pm UTC](https://discourse.codecombat.com/t/noble-sacrifice-python-bonus-help-solved/27950/2 "2021-03-15T14:20:55Z")

</div>

delete the while-true loop

> [@Some\_Guy](#):
>
> `while True:`

---

<div class="post-metadata">

**Author:** ![Some\_Guy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/some_guy/32/20317_2.png) [@Some\_Guy](https://discourse.codecombat.com/u/Some_Guy)\
**Post date:** [March 15, 2021, 2:22pm UTC](https://discourse.codecombat.com/t/noble-sacrifice-python-bonus-help-solved/27950/3 "2021-03-15T14:22:48Z")

</div>

Nope i found out what i did wrong I flipped the positions somehow‽

---

<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:** [March 15, 2021, 2:24pm UTC](https://discourse.codecombat.com/t/noble-sacrifice-python-bonus-help-solved/27950/4 "2021-03-15T14:24:18Z")

</div>

Oh that is weird. Congrats on finishing the level anyways 🥳 🥳 🥳

---

<div class="post-metadata">

**Author:** ![Some\_Guy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/some_guy/32/20317_2.png) [@Some\_Guy](https://discourse.codecombat.com/u/Some_Guy)\
**Post date:** [March 15, 2021, 2:24pm UTC](https://discourse.codecombat.com/t/noble-sacrifice-python-bonus-help-solved/27950/5 "2021-03-15T14:24:52Z")

</div>

Thanks i have no idea how that even happened

---

<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:** [March 16, 2021, 2:25am UTC](https://discourse.codecombat.com/t/noble-sacrifice-python-bonus-help-solved/27950/6 "2021-03-16T02:25:02Z")

</div>

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