# I am not sure why i am getting "unexpected token: void" any help with this would be greatly appreaciated

**URL:** https://discourse.processing.org/t/i-am-not-sure-why-i-am-getting-unexpected-token-void-any-help-with-this-would-be-greatly-appreaciated/13462
**Category:** Beginners
**Created:** [August 19, 2019, 1:36am UTC](https://discourse.processing.org/t/i-am-not-sure-why-i-am-getting-unexpected-token-void-any-help-with-this-would-be-greatly-appreaciated/13462 "2019-08-19T01:36:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Heatwave87](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@Heatwave87](https://discourse.processing.org/u/Heatwave87)
#### Post date: [August 19, 2019, 1:36am UTC](https://discourse.processing.org/t/i-am-not-sure-why-i-am-getting-unexpected-token-void-any-help-with-this-would-be-greatly-appreaciated/13462/1 "2019-08-19T01:36:09Z")

</div>

I believe I have done this code correctly bet I am new to processing so it might be wrong the code is here if anyone can help. I am trying to make a dog face and the background changes to a random colour when I click.

```auto
color bColor = color(255, 255, 255);

void setup() {

size(500,500);

fill(15,15,15);
rect(110,80,60,20);// first eyebrow
ellipse(140,120,20,20);//eye
rect(280,80,60,20);// second eyebrow
ellipse(310,120,20,20);//eye
triangle(270,155,230,245,180,155);//nose

{ noFill();
 arc(200, 230, 70, 50, 0, PI); // mouth
 arc(200, 230, 70, 50, 0, PI); // mouth
 arc(200, 230, 70, 50, 0, PI); // mouth
 
 arc(260, 230, 70, 50, 0, PI); // mouth
 arc(260, 230, 70, 50, 0, PI); // mouth
 arc(260, 230, 70, 50, 0, PI); // mouth
}
fill(24,24,24);
 rect(157,280,150,30); // bone shape 
ellipse(160,280,40,40); // circles to complete bone shape
ellipse(160,310,40,40); // circles to complete bone shape
ellipse(310,280,40,40); // circles to complete bone shape
ellipse(310,310,40,40); // circles to complete bone shape
fill(82,36,224);
textSize(32);
text("CREEKER PETS",140,400); 
fill(34,6,121);
line(140,405,360,405); // underlining words 
}

{
void draw()background(bColor);
}
void mousePressed() {
  bColor= color(random(255), random(255), random (255));

```

---

<div class="post-metadata">

### Author: ![humayung](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/humayung/32/6089_2.png) [@humayung](https://discourse.processing.org/u/humayung)
#### Post date: [August 19, 2019, 3:10am UTC](https://discourse.processing.org/t/i-am-not-sure-why-i-am-getting-unexpected-token-void-any-help-with-this-would-be-greatly-appreaciated/13462/2 "2019-08-19T03:10:57Z")

</div>

> [@Heatwave87](#):
>
> ```auto
> {
> void draw()background(bColor);
> }
> void mousePressed() {
> bColor= color(random(255), random(255), random (255));
> 
> ```

Seem suspicious, Rewrite this block of code

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [August 19, 2019, 3:24pm UTC](https://discourse.processing.org/t/i-am-not-sure-why-i-am-getting-unexpected-token-void-any-help-with-this-would-be-greatly-appreaciated/13462/3 "2019-08-19T15:24:51Z")

</div>

Don’t do this:

```auto
{
   void aFunction() aCommand();
}

```

instead do this:

```auto
void aFunction() {
  aCommand();
  aCommand();
}

```

Also, get rid of the { } here:

```auto
{ noFill();
// ...
}
fill(24,24,24);

```

You can add { } almost anywhere, but they probably aren’t doing what you think they are. Only use them like this:

[https://processing.org/reference/curlybraces.html](https://processing.org/reference/curlybraces.html)
