# Is it the programmed code or a bug? Help, please

**URL:** <https://forum.code.org/t/is-it-the-programmed-code-or-a-bug-help-please/15430>\
**Category:** Unit and Lesson Discussion\
**Tags:** csd-unit-3, csd-unit-3-lesson-22\
**Created:** [April 6, 2018, 4:27pm UTC](https://forum.code.org/t/is-it-the-programmed-code-or-a-bug-help-please/15430 "2018-04-06T16:27:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tashabaum](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/tashabaum/32/3518_2.png) [@tashabaum](https://forum.code.org/u/tashabaum)\
**Post date:** [April 6, 2018, 4:27pm UTC](https://forum.code.org/t/is-it-the-programmed-code-or-a-bug-help-please/15430/1 "2018-04-06T16:27:31Z")

</div>

> **[Check out what I made](https://studio.code.org/projects/gamelab/qq2JEl9Z1SjLF-sYqJFzkrQcIQPK_4HrlnGpQtxfkuQ)**
>
> I wrote the code myself with Code.org

greenFIshL and flashyFIshDL are not functioning properly. I’ve checked the var code and the loop function.

Any ideas before I report it as a bug?

Thank you.

My students are trying to get their games functioning for an Adventure Race station on 04/28.

---

<div class="post-metadata">

**Author:** ![josh](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/josh/32/868_2.png) [@josh](https://forum.code.org/u/josh)\
**Post date:** [April 6, 2018, 4:45pm UTC](https://forum.code.org/t/is-it-the-programmed-code-or-a-bug-help-please/15430/2 "2018-04-06T16:45:26Z")

</div>

Ask the student to walk through the logic in the fish looping functions, specifically starting at line 166. If they _really_ read through the code and talk it through aloud I bet they find the bug.

```javascript
function loopGreenFishL () {
  if (greenFishL.x < 0 ) {
   greenFishL.x = 400;
   greenFishL.velocityX = greenFishL.velocityX +1;
  }
}
function loopGreenFishR () {
  if (greenFishR.x > 400 ) {
   greenFishL.x = 0;
  }
}

```
