# Zig Zag and Zoom - Python

**URL:** <https://discourse.codecombat.com/t/zig-zag-and-zoom-python/25786>\
**Category:** Level Help\
**Created:** [December 1, 2020, 10:23pm UTC](https://discourse.codecombat.com/t/zig-zag-and-zoom-python/25786 "2020-12-01T22:23:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlwaysConfused](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/alwaysconfused/32/20546_2.png) [@AlwaysConfused](https://discourse.codecombat.com/u/AlwaysConfused)\
**Post date:** [December 1, 2020, 10:23pm UTC](https://discourse.codecombat.com/t/zig-zag-and-zoom-python/25786/1 "2020-12-01T22:23:45Z")

</div>

So basically, i tried zig zag and zoom and on the third zigzag he gets stuck in his walking animation, standing there, doing nothing. Here is my code

```python
# Escape from Death Valley!
# Move by with a zigzag pattern using real modulo functions.

# This function returns a value from 0 to 15:
def mod15(n):
    while n >= 15:
        n -= 15
    return n

# This function should return a value from 0 to 9:
def mod9(n):
    # While n is greater or equal to 9, subtract 9 from n:
    while n >= 9:
        n - 9
    return n

# Don't change the following code:
while True:
    time = hero.time
    if time < 30:
        y = 10 + 3 * mod15(time)
    else:
        y = 20 + 3 * mod9(time)
    x = 10 + time
    hero.moveXY(x, y)

```

---

<div class="post-metadata">

**Author:** ![AlwaysConfused](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/alwaysconfused/32/20546_2.png) [@AlwaysConfused](https://discourse.codecombat.com/u/AlwaysConfused)\
**Post date:** [December 1, 2020, 10:24pm UTC](https://discourse.codecombat.com/t/zig-zag-and-zoom-python/25786/2 "2020-12-01T22:24:07Z")

</div>

I have tried reloading the page but it doesnt work.

---

<div class="post-metadata">

**Author:** ![AlwaysConfused](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/alwaysconfused/32/20546_2.png) [@AlwaysConfused](https://discourse.codecombat.com/u/AlwaysConfused)\
**Post date:** [December 1, 2020, 10:26pm UTC](https://discourse.codecombat.com/t/zig-zag-and-zoom-python/25786/3 "2020-12-01T22:26:40Z")

</div>

Error says Line 13 Statement Execution Limit Reached.

---

<div class="post-metadata">

**Author:** ![AlwaysConfused](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/alwaysconfused/32/20546_2.png) [@AlwaysConfused](https://discourse.codecombat.com/u/AlwaysConfused)\
**Post date:** [December 1, 2020, 10:27pm UTC](https://discourse.codecombat.com/t/zig-zag-and-zoom-python/25786/4 "2020-12-01T22:27:04Z")

</div>

I guess CodeCombat likes levels when they’re fast. Unfortunately this is a slow level.

---

<div class="post-metadata">

**Author:** ![abc](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@abc](https://discourse.codecombat.com/u/abc)\
**Post date:** [December 1, 2020, 10:40pm UTC](https://discourse.codecombat.com/t/zig-zag-and-zoom-python/25786/5 "2020-12-01T22:40:29Z")

</div>

Try changing `n - 9` to `n -= 9` like the `n -= 15` part.

---

<div class="post-metadata">

**Author:** ![Lydia\_Song](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lydia_song/32/31461_2.png) [@Lydia\_Song](https://discourse.codecombat.com/u/Lydia_Song)\
**Post date:** [December 1, 2020, 11:40pm UTC](https://discourse.codecombat.com/t/zig-zag-and-zoom-python/25786/6 "2020-12-01T23:40:08Z")

</div>

> [@AlwaysConfused](#):
>
> ` n - 9`

Add a equal sign in between - and 9  
Lydia

---

<div class="post-metadata">

**Author:** ![WaWa\_Yang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/wawa_yang/32/17800_2.png) [@WaWa\_Yang](https://discourse.codecombat.com/u/WaWa_Yang)\
**Post date:** [December 2, 2020, 12:03am UTC](https://discourse.codecombat.com/t/zig-zag-and-zoom-python/25786/7 "2020-12-02T00:03:35Z")

</div>

wheres the level? Is it subscriber?

---

<div class="post-metadata">

**Author:** ![WaWa\_Yang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/wawa_yang/32/17800_2.png) [@WaWa\_Yang](https://discourse.codecombat.com/u/WaWa_Yang)\
**Post date:** [December 2, 2020, 12:04am UTC](https://discourse.codecombat.com/t/zig-zag-and-zoom-python/25786/8 "2020-12-02T00:04:56Z")

</div>

oh wait no its in the desert

---

<div class="post-metadata">

**Author:** ![WaWa\_Yang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/wawa_yang/32/17800_2.png) [@WaWa\_Yang](https://discourse.codecombat.com/u/WaWa_Yang)\
**Post date:** [December 2, 2020, 12:07am UTC](https://discourse.codecombat.com/t/zig-zag-and-zoom-python/25786/9 "2020-12-02T00:07:11Z")

</div>

oh ok … Try what @Lydia_Song said and it should work 😃
