# Sarven Sum Help

**URL:** <https://discourse.codecombat.com/t/sarven-sum-help/36186>\
**Category:** Uncategorized\
**Created:** [October 10, 2023, 6:21pm UTC](https://discourse.codecombat.com/t/sarven-sum-help/36186 "2023-10-10T18:21:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andres\_Martin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/andres_martin/32/35007_2.png) [@Andres\_Martin](https://discourse.codecombat.com/u/Andres_Martin)\
**Post date:** [October 10, 2023, 6:21pm UTC](https://discourse.codecombat.com/t/sarven-sum-help/36186/1 "2023-10-10T18:21:50Z")

</div>

# To disable the fire-traps add the lowest trap.value to the highest value.

# Move to the white X and say the answer to Kitty the cougar.

# Defeat all the ogres if you dare.

# Once all ogres are defeated move to the red X.

# Look out for potions to boost your health.

points = {‘x’: 65, ‘y’: 103}, {‘x’: 69, ‘y’: 28}, {‘x’: 122, ‘y’: 78}, {‘x’: 151, ‘y’: 118}  
whiteX = {‘x’:27, ‘y’:42}  
redX = {‘x’:151 , ‘y’: 118}

def attack(enemy):  
enemy = hero.findNearestEnemy()  
if enemy:  
hero.attack(enemy)

def drinkPotion(item):  
item = hero.findNearestItem()  
if item and item.type != “poison”:  
hero.moveXY(item.pos.x, item.pos.y)

hero.moveXY(whiteX.x, whiteX.y)  
max = 0  
min = 999  
hazards = hero.findHazards()  
for hazard in hazards:  
if hazard.value \> min:  
min = hazard.value  
if hazard.value \< max:  
max = hazard.value  
hero.say(min + max)

```
pointIndex = 0

```

while True:

```
enemy = hero.findNearestEnemy()
item = hero.findNearestItem()
if enemy:
    hero.attack(enemy)
elif item:
    drinkPotion(item)
else:
    hero.moveXY(point["x"], point["y"])
    pointIndex += 1
    continue

```

here’s my code, why am I trapped on the part where you deactivate the traps?

---

<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:** [October 11, 2023, 2:23pm UTC](https://discourse.codecombat.com/t/sarven-sum-help/36186/2 "2023-10-11T14:23:48Z")

</div>

Could you please properly format all of your code and share the level link so you can receive the proper help that you are asking for please. Thanks

–Nightwing
