Getting error writing code in Projects Book -- Spaceship Interface

Hello,
I'm brand new to this and just bought the Starter Kit today.

I have typed in the code for the Spaceship Interface but when I hit Verify or Upload I get the following error: Expected unqualified-id before numeric constant. Line 2 is in yellow and the cursor is flashing at the end of the line. I can't find anything wrong with spelling or syntax.

The following is a copy of my code attempt:

1 int switchState = 0;
2 void setup(){
3 pinMode (3,OUTPUT);
4 pinMode (4,OUTPUT);
5 pinMode (5,OUTPUT);
6 pinMode (2,INPUT);
7}
8 void loop(){
9 switchState = digitalRead(2);
10 // COMMENT EXAMPLE
11 if (switchState == LOW) {
12 // the button is not pressed
13 digitalWrite(3, HIGH); // green led
14 digitalWrite(4, LOW); // red led
15 digitalWrite(5, LOW); // red led
16 }
17 else { // button is pressed
18 digitalWrite(3, LOW);
19 digitalWrite(4, LOW);
20 digitalWrite(5, HIGH);
21 delay(250); wait for a quarter second
22 // toggle the leds
23 digitalWrite(4, HIGH);
24 digitalWrite(5, LOW);
25 delay(250); // wait for a quarter second
26 }
27 } // go back to beginning of loop

Here is a link to the project on the website:

Thanks,
Steve

Just noticed an error in line 21. I left out the // for the comment. I have fixed that and I still get the same error as before.

Greetings,

Steve51:
The following is a copy of my code attempt:

1 int switchState = 0;
2 void setup(){
3 pinMode (3,OUTPUT);
...

Are you including the numbers on the far left (1, 2, 3)?

Yes; ah, should I NOT be?

Are you using the Arduino IDE? Did you try to compile the code with the line numbers in the sketch? Get rid of the line numbers and try it.

Yep, that was my mistake. Thanks to both of you. I'm a rank beginner at this.

Steve

Success! Project works as designed! Thanks again.

Steve51:
Thanks to both of you.

You are welcome.

I'm a rank beginner at this.

At some point in time, we all have been. Not even Alan Turing was born knowing how to program.