# I don't see my issue in this simple code (JavaScript)

**URL:** <https://discourse.codecombat.com/t/i-dont-see-my-issue-in-this-simple-code-javascript/9009>\
**Category:** Uncategorized\
**Created:** [September 20, 2016, 5:47pm UTC](https://discourse.codecombat.com/t/i-dont-see-my-issue-in-this-simple-code-javascript/9009 "2016-09-20T17:47:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pramerios](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@Pramerios](https://discourse.codecombat.com/u/Pramerios)\
**Post date:** [September 20, 2016, 5:47pm UTC](https://discourse.codecombat.com/t/i-dont-see-my-issue-in-this-simple-code-javascript/9009/1 "2016-09-20T17:47:55Z")

</div>

# I don't see my issue in this simple code.

Could someone help me figure out what the issue is with this code? I've tried my best, but I can't seem to figure it out.

![](http://s15.postimg.org/muoi3mvff/Glitch.png)

The level I'm currently on has the player on one side of the screen, and the other side of the screen is littered with poison and coins. I need to get the gems but avoid the poison. I avoid the peons because they're dying from the poison, but I'm attacking any ogres I see. Problem is, while the hero is attacking the ogres, he's not moving to get any coins. Where am I making my mistake?

---

<div class="post-metadata">

**Author:** ![htrnblr](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@htrnblr](https://discourse.codecombat.com/u/htrnblr)\
**Post date:** [September 21, 2016, 10:23am UTC](https://discourse.codecombat.com/t/i-dont-see-my-issue-in-this-simple-code-javascript/9009/2 "2016-09-21T10:23:13Z")

</div>

Ctrl-X Ctrl-V  
one of "}"  
from the line 12 to the line 17

Your while loop ends on line 12  
Try to use the default style  
closing } under keyword

```python
while (true) {
}
if (true) {
}

```

---

<div class="post-metadata">

**Author:** ![Pramerios](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@Pramerios](https://discourse.codecombat.com/u/Pramerios)\
**Post date:** [September 22, 2016, 3:27am UTC](https://discourse.codecombat.com/t/i-dont-see-my-issue-in-this-simple-code-javascript/9009/3 "2016-09-22T03:27:13Z")

</div>

# Thanks.

* * *
 Thanks a ton! Moving the bracket from 12 to 17 fixed it. You rock!
