# Unexpected token:void

**URL:** https://discourse.processing.org/t/unexpected-token-void/4430
**Category:** Coding Questions
**Created:** [October 13, 2018, 3:54pm UTC](https://discourse.processing.org/t/unexpected-token-void/4430 "2018-10-13T15:54:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sissib](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@sissib](https://discourse.processing.org/u/sissib)
#### Post date: [October 13, 2018, 3:54pm UTC](https://discourse.processing.org/t/unexpected-token-void/4430/1 "2018-10-13T15:54:47Z")

</div>

here is my code:

```auto
float xcoord;
float ycoord;
float npoints;
float xdivider;
float ydivider;

void setup () {
     size (600,600);
     npoints=12;
     xdivider=width/(npoints+1);
     ydivider=height/(npoints+1);
     smooth();
     
  
  }
  
  void draw (){
     background (51);
     xcoord=xdivider;
     ycoord=ydivider;
     
     for (int j=0;j<npoints;j++)
     {
       for (int i=0;i<npoints;i++)
       {
     
  star(xcoord,ycoord);

  xcoord=xcoord+xdivider;
  
  }
  xcoord=xdivider;
  ycoord=ycoord+ydivider;
  
  }
  
  
  
  void star (float x, float y)
{
  
   pushMatrix();
     translate (x,y);
     fill(127);
     stroke(255);
     strokeWeight(2);
     //vertices of the star
     beginShape ();
     vertex(x,y-50);
     vertex(x+14,y-20);
     vertex(x+47,y-15);
     vertex(x+23,y+7);
     vertex(x+29,y+40);
     vertex(x,y+25);
     vertex(x-29,y+40);
     vertex(x-23,y+7);
     vertex(x-47,y-15);
     vertex(x-14,y-20);
     endShape (CLOSE);
     
     popMatrix();
  
  }

```

when i try to play it, it ids not working because al the line `void star (float x, float y)` it says `unexpected token:void`

what can i do?

many thanks

---

<div class="post-metadata">

### Author: ![dan850](https://avatars.discourse-cdn.com/v4/letter/d/e9c0ed/32.png) [@dan850](https://discourse.processing.org/u/dan850)
#### Post date: [October 13, 2018, 7:51pm UTC](https://discourse.processing.org/t/unexpected-token-void/4430/2 "2018-10-13T19:51:54Z")

</div>

Hi @sissib make sure you use the pre-formatted code button “\</\>”

And from looking at your code, it looks like you’re missing a curly brace at the end of your for Loop.🙂
