# Expecting EOF, found if. idk how to fix it

**URL:** <https://discourse.processing.org/t/expecting-eof-found-if-idk-how-to-fix-it/17468>\
**Category:** Beginners\
**Created:** [January 30, 2020, 9:17pm UTC](https://discourse.processing.org/t/expecting-eof-found-if-idk-how-to-fix-it/17468 "2020-01-30T21:17:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prototype\_31](https://avatars.discourse-cdn.com/v4/letter/p/ea666f/32.png) [@prototype\_31](https://discourse.processing.org/u/prototype_31)\
**Post date:** [January 30, 2020, 9:17pm UTC](https://discourse.processing.org/t/expecting-eof-found-if-idk-how-to-fix-it/17468/1 "2020-01-30T21:17:23Z")

</div>

```auto
void setup(){
  size(2000,2000);
  background(0);
}
void keyPressed() {

//1st planet
  if (key == 'b' || key == 'B') {
  if (keyPressed)
      stroke(0);
      fill(0);
    }
   else {
    stroke(#18B733);
    fill(#18B733);
  }
  ellipse(200, 200,200,200);
}
     
  if(key == 'b' || key == 'B') {
  if (keyPressed)
      stroke(0);
      fill(0);
    }
   else {
    stroke(#FF002F);
    fill(#FF002F);
  }
  ellipse(150, 150,150,150);
}

```

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 30, 2020, 9:34pm UTC](https://discourse.processing.org/t/expecting-eof-found-if-idk-how-to-fix-it/17468/2 "2020-01-30T21:34:33Z")

</div>

with ctrl-t you can get auto-indent

then you see, where the error is

You had one } too much

I marked it here for you:

```auto
void setup() {
  size(2000, 2000);
  background(0);
}
void keyPressed() {

  //1st planet
  if (key == 'b' || key == 'B') {
    if (keyPressed)
      stroke(0);
    fill(0);
  } else {
    stroke(#18B733);
    fill(#18B733);
  }
  ellipse(200, 200, 200, 200);
} // !!!!!!!!!!!!! delete this 

if (key == 'b' || key == 'B') {
  if (keyPressed)
    stroke(0);
  fill(0);
} else {
  stroke(#FF002F);
  fill(#FF002F);
}
ellipse(150, 150, 150, 150);
}

```
