# Treasured in Ice help!

**URL:** <https://discourse.codecombat.com/t/treasured-in-ice-help/13406>\
**Category:** Uncategorized\
**Created:** [January 2, 2018, 6:44pm UTC](https://discourse.codecombat.com/t/treasured-in-ice-help/13406 "2018-01-02T18:44:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ironhead](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ironhead/32/7384_2.png) [@Ironhead](https://discourse.codecombat.com/u/Ironhead)\
**Post date:** [January 2, 2018, 6:44pm UTC](https://discourse.codecombat.com/t/treasured-in-ice-help/13406/1 "2018-01-02T18:44:12Z")

</div>

This is my code:

```python
while True:
    pathUp = hero.isPathClear({'x':hero.pos.x,'y':hero.pos.y + 10})
    pathDown = hero.isPathClear({'x':hero.pos.x,'y':hero.pos.y - 10})
    pathRight = hero.isPathClear({'x':hero.pos.x- 10, 'y':hero.pos.y})
    pathLeft = hero.isPathClear({'x':hero.pos.x + 10, 'y':hero.pos.y})
    if pathUp:
        hero.moveUp()
    if pathDown:
        hero.moveDown()
    if pathRight:
        hero.moveRight()
    if pathLeft:
        hero.moveLeft()

```

Why does it keep on returning error? That’s all I need to know.

---

<div class="post-metadata">

**Author:** ![kyay10](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/kyay10/32/7337_2.png) [@kyay10](https://discourse.codecombat.com/u/kyay10)\
**Post date:** [January 2, 2018, 9:38pm UTC](https://discourse.codecombat.com/t/treasured-in-ice-help/13406/2 "2018-01-02T21:38:08Z")

</div>

is path clear needs a start and a end, so the code should be

```python
pathUp = hero.isPathClear(hero.pos, {'x':hero.pos.x,'y':hero.pos.y + 10})

```
