# Oasis coding help

**URL:** <https://discourse.codecombat.com/t/oasis-coding-help/2443>\
**Category:** Uncategorized\
**Created:** [January 25, 2015, 12:25am UTC](https://discourse.codecombat.com/t/oasis-coding-help/2443 "2015-01-25T00:25:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluedoggy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/bluedoggy/32/1977_2.png) [@bluedoggy](https://discourse.codecombat.com/u/bluedoggy)\
**Post date:** [January 25, 2015, 12:25am UTC](https://discourse.codecombat.com/t/oasis-coding-help/2443/1 "2015-01-25T00:25:13Z")

</div>

I cant figure out the code for Oasis. I was wondering if anyone could either help me with it or could give me the code?

---

<div class="post-metadata">

**Author:** ![bluedoggy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/bluedoggy/32/1977_2.png) [@bluedoggy](https://discourse.codecombat.com/u/bluedoggy)\
**Post date:** [January 25, 2015, 12:34am UTC](https://discourse.codecombat.com/t/oasis-coding-help/2443/2 "2015-01-25T00:34:01Z")

</div>

never mind, the code ended up being really simple:

```python
# Move forward to reach the oasis,
# but move back to avoid nearby yaks.
loop:
    enemy = self.findNearestEnemy()
    if enemy and self.distanceTo(enemy) < 10:
        # Move to the left by subtracting 10 from your X coordinate.
        pass
        
    else:
        # Move to the right by adding 10 to your X coordinate.
        pass
        x = self.pos.x +10
        y = self.pos.y 
        self.moveXY(x, y)

```
