Space ship Code not working need help

Hello I am currently working on project 2 Space ship interface I am currently coding it and have finished it but when I went to verify it says "expected unqualified-id before else" Can someone tell me what I am doing wrong thanks :slight_smile:

int switchState = 0;
void setup(){
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(2, INPUT);
}  void loop(){
    switchState = digitalRead(2);
    //this is a comment
    if (switchState == LOW) 
    // the button is not pressed
    digitalWrite(3, HIGH); //green LED
    digitalWrite(4, LOW); // red LED
    digitalWrite(5, LOW); //red LED
}
   else { // the button is pressed This is where it is not working i am not sure what is wrong with it
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
    digitalWrite(5, HIGH);
    delay(250); //wair for quarter second
    //toggle the LEDs
    digitalWrite(4, HIGH);
    digitalWrite(5 LOW);
    delay(250); //wait for a quarter second
    

    
  }

if (switchState == LOW) {

You're also missing one of these }

Is there any point on the learning curve where you do NOT constantly have to go back and add missed semicolons and brackets...? :slight_smile: still happens to me all the time...

You should always put pairs of them in.
So, when you write {, you should automatically put in its twin.

Isomeric twins

GreyArea:
Is there any point on the learning curve where you do NOT constantly have to go back and add missed semicolons and brackets...? :slight_smile: still happens to me all the time...

Yes. I no longer have issues with writing Fortran code.