# Sarven Sum Problem

**URL:** <https://discourse.codecombat.com/t/sarven-sum-problem/9502>\
**Category:** Uncategorized\
**Created:** [November 1, 2016, 9:12pm UTC](https://discourse.codecombat.com/t/sarven-sum-problem/9502 "2016-11-01T21:12:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MunkeyShynes](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/munkeyshynes/32/9277_2.png) [@MunkeyShynes](https://discourse.codecombat.com/u/MunkeyShynes)\
**Post date:** [November 1, 2016, 9:12pm UTC](https://discourse.codecombat.com/t/sarven-sum-problem/9502/1 "2016-11-01T21:12:55Z")

</div>

```python
# 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.
whiteX = {'x':27, 'y':42}
redX = {'x':151, 'y': 118}
while True:
    traps = hero.findByType("fire-trap")
    lowestTrap = None
    highestTrap = None
    minTrapVal = 0
    maxTrapVal = 999999
    trapIndex = 0
    while trapIndex < len(traps):
        if traps[trapIndex].value < maxTrapVal:
            lowestTrap = traps[trapIndex]
            maxTrapVal = lowestTrap.value
        if traps[trapIndex].value > minTrapVal:
            highestTrap = traps[trapIndex]
            minTrapVal = highestTrap.value
        trapIndex += 1
    hero.move(whiteX) # **This isn't working.** If I use hero.moveXY(27, 42) it works.
                     # What is the difference and why isn't whiteX working?
    hero.say(lowestTrap.value + highestTrap.value)
    break

```

In the first part where movement is to hero.move(whiteX), the character says the answer (number) without moving and then just wanders into the active fire-traps. However, if I use hero.moveXY(27, 42) everything works fine. I can’t figure out why or what the difference is. Since whiteX is clearly defined I would think that either should work. I have the correct boots and the **hero.move(redX) is working fine** but hero.move(whiteX) is not. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Serg](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/serg/32/3260_2.png) [@Serg](https://discourse.codecombat.com/u/Serg)\
**Post date:** [November 2, 2016, 8:52pm UTC](https://discourse.codecombat.com/t/sarven-sum-problem/9502/2 "2016-11-02T20:52:03Z")

</div>

You’re using advanced boots.

`hero.move(object w/ x, y properties)` tells your hero to take a singular step towards x/y.  
`hero.moveXY(x, y)` tells your hero to move to that location and not do anything else until they arrive.

You have a `break` in your `while-true` so after you take 1 step towards whiteX and say the lowest+highest trap value, you quit out of the loop and stop doing stuff.

Just understand the difference between `move` and `moveXY` and replace your `hero.move(whiteX)` with a `moveXY` instead.
