# \[SOLVED\]The two flowers help

**URL:** <https://discourse.codecombat.com/t/solved-the-two-flowers-help/25774>\
**Category:** Level Help\
**Created:** [December 1, 2020, 1:36pm UTC](https://discourse.codecombat.com/t/solved-the-two-flowers-help/25774 "2020-12-01T13:36:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manuel\_Morales](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/manuel_morales/32/16584_2.png) [@Manuel\_Morales](https://discourse.codecombat.com/u/Manuel_Morales)\
**Post date:** [December 1, 2020, 1:36pm UTC](https://discourse.codecombat.com/t/solved-the-two-flowers-help/25774/1 "2020-12-01T13:36:15Z")

</div>

I cant seem to beat this level  
here is my cade

```python
# If the peasant is damaged, the flowers will shrink!
enemy = hero.findNearestEnemy()
def summonSoldiers():
    if hero.gold >= hero.costOf("soldier"):
        hero.summon("soldier")
# Define the function: commandSoldiers
def commandSoldiers():
    soldiers = hero.findByType("soldier")
    for soldier in soldiers:
        hero.command(soldier, "defend", peasant)
        if enemy:
            hero.command(soldier, "attack", enemy)
        # Define the function: pickUpNearestCoin
def pickUpNearestCoin():
    items = hero.findItems()
    for item in items:
        coin = hero.findNearestItem()
        hero.move(coin.pos)
def attack():
    if enemy:
        hero.attack(enemy)
peasant = hero.findByType("peasant")[0]
def cleave():
    if hero.isReady("cleave"):
        hero.move(hero.pos)
        hero.cleave(enemy)

while True:
    attack()
    cleave()
    summonSoldiers()
    # commandSoldiers()
    commandSoldiers()
    # pickUpNearestCoin()
    pickUpNearestCoin()

```

---

<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 1, 2020, 1:40pm UTC](https://discourse.codecombat.com/t/solved-the-two-flowers-help/25774/2 "2020-12-01T13:40:41Z")

</div>

for pickUpNearest Coin if you have thornprick just do  
friend = hero.findFriends()  
hero.move(friend.pos)  
eventually you will cram the peasant in to the forest he won’t get hurt because your covering him and the flowers will grow. Note: you would have to submit a few times until it works

---

<div class="post-metadata">

**Author:** ![Manuel\_Morales](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/manuel_morales/32/16584_2.png) [@Manuel\_Morales](https://discourse.codecombat.com/u/Manuel_Morales)\
**Post date:** [December 1, 2020, 1:41pm UTC](https://discourse.codecombat.com/t/solved-the-two-flowers-help/25774/3 "2020-12-01T13:41:49Z")

</div>

so put on thronpick and do that?

---

<div class="post-metadata">

**Author:** ![Manuel\_Morales](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/manuel_morales/32/16584_2.png) [@Manuel\_Morales](https://discourse.codecombat.com/u/Manuel_Morales)\
**Post date:** [December 1, 2020, 1:42pm UTC](https://discourse.codecombat.com/t/solved-the-two-flowers-help/25774/4 "2020-12-01T13:42:35Z")

</div>

and delete pickupnearetcoin?

---

<div class="post-metadata">

**Author:** ![Manuel\_Morales](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/manuel_morales/32/16584_2.png) [@Manuel\_Morales](https://discourse.codecombat.com/u/Manuel_Morales)\
**Post date:** [December 1, 2020, 1:44pm UTC](https://discourse.codecombat.com/t/solved-the-two-flowers-help/25774/5 "2020-12-01T13:44:30Z")

</div>

good i got it thanks

---

<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 1, 2020, 1:45pm UTC](https://discourse.codecombat.com/t/solved-the-two-flowers-help/25774/6 "2020-12-01T13:45:56Z")

</div>

your welcome and good luck

---

<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 2, 2020, 1:45am UTC](https://discourse.codecombat.com/t/solved-the-two-flowers-help/25774/7 "2020-12-02T01:45:59Z")

</div>

Closed on December 2, 2020, 1:45am UTC

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