# FizzBuzz Path: Help Please!

**URL:** <https://discourse.codecombat.com/t/fizzbuzz-path-help-please/36004>\
**Category:** Level Help\
**Created:** [September 1, 2023, 3:40pm UTC](https://discourse.codecombat.com/t/fizzbuzz-path-help-please/36004 "2023-09-01T15:40:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![milescombat](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/milescombat/32/34822_2.png) [@milescombat](https://discourse.codecombat.com/u/milescombat)\
**Post date:** [September 1, 2023, 3:40pm UTC](https://discourse.codecombat.com/t/fizzbuzz-path-help-please/36004/1 "2023-09-01T15:40:18Z")

</div>

I’m sure I did the code right, but it’s still not working. Could anyone help me please? I’ll show you my code

```python
let steps = 1;
while (true) {
    // If the number of steps is divisible by 3 AND by 5 -- move to North-West.
    if (steps % 3 === 0 && steps & 5 === 0) {
        hero.moveXY(hero.pos.x - 10, hero.pos.y + 10);
    }   
    // Else if the number of steps is divisible by 3 -- move to East.
    else if (steps % 3 === 0) {
        hero.moveXY(hero.pos.x + 10, hero.pos.y);
    }    
    // Else if the number of steps is divisible by 5 -- move to West.
    else if (steps % 5 === 0) {
        hero.moveXY(hero.pos.x - 10, hero.pos.y);
    }    
    // Else move to North.
    else {
        hero.moveXY(hero.pos.x, hero.pos.y + 10);
    }
    hero.moveXY(hero.pos.x, hero.pos.y + 10);
    steps += 1;
}

```

---

<div class="post-metadata">

**Author:** ![JustALuke](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/justaluke/32/43608_2.png) [@JustALuke](https://discourse.codecombat.com/u/JustALuke)\
**Post date:** [September 1, 2023, 4:47pm UTC](https://discourse.codecombat.com/t/fizzbuzz-path-help-please/36004/2 "2023-09-01T16:47:04Z")

</div>

`&` Should be `%` on line 4

---

<div class="post-metadata">

**Author:** ![milescombat](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/milescombat/32/34822_2.png) [@milescombat](https://discourse.codecombat.com/u/milescombat)\
**Post date:** [September 1, 2023, 5:28pm UTC](https://discourse.codecombat.com/t/fizzbuzz-path-help-please/36004/3 "2023-09-01T17:28:50Z")

</div>

Oops. I could have figured that out, but it is still doing just going straight and running into a coin bomb.

---

<div class="post-metadata">

**Author:** ![JustALuke](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/justaluke/32/43608_2.png) [@JustALuke](https://discourse.codecombat.com/u/JustALuke)\
**Post date:** [September 1, 2023, 5:42pm UTC](https://discourse.codecombat.com/t/fizzbuzz-path-help-please/36004/4 "2023-09-01T17:42:02Z")

</div>

> [@milescombat](#):
>
> `hero.moveXY(hero.pos.x, hero.pos.y + 10);`

I forget what this level is about, but is the second line of this code supposed to be there after the else statement?

---

<div class="post-metadata">

**Author:** ![milescombat](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/milescombat/32/34822_2.png) [@milescombat](https://discourse.codecombat.com/u/milescombat)\
**Post date:** [September 1, 2023, 5:43pm UTC](https://discourse.codecombat.com/t/fizzbuzz-path-help-please/36004/5 "2023-09-01T17:43:41Z")

</div>

I noticed that too. I’ll delete it to see what happens.

---

<div class="post-metadata">

**Author:** ![milescombat](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/milescombat/32/34822_2.png) [@milescombat](https://discourse.codecombat.com/u/milescombat)\
**Post date:** [September 1, 2023, 5:47pm UTC](https://discourse.codecombat.com/t/fizzbuzz-path-help-please/36004/6 "2023-09-01T17:47:38Z")

</div>

Thanks a ton! I deleted it and it worked! 👍

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/a/a9445509d1a758c41b5ddcddc8c8e20a5dedb67f.png) [@system](https://discourse.codecombat.com/u/system)\
**Post date:** [September 2, 2023, 5:48am UTC](https://discourse.codecombat.com/t/fizzbuzz-path-help-please/36004/7 "2023-09-02T05:48:08Z")

</div>

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
