Getting errors compiling a line follower code??

hey
i'm writing a line follower code on arduino and motor shield
i'm getting alot of errors tring to verify the code
here is the code :

#include <AFMotor.h>

const int Sensor1 = 2; 
const int Sensor2 = 3; 
const int Sensor3 = 4; 
const int Sensor4 = 5; 
const int Sensor5 = 6; 

int SensorState1 = 0; 
int SensorState2 = 0; 
int SensorState3 = 0; 
int SensorState4 = 0; 
int SensorState5 = 0; 



AF_DCMotor MotorR(1, MOTOR12_64KHZ);
AF_DCMotor MotorL(2, MOTOR12_64KHZ);


void setup() {
 Serial.begin(9600);
 pinMode(Sensor1, INPUT);
 pinMode(Sensor2, INPUT);
 pinMode(Sensor3, INPUT);
 pinMode(Sensor4, INPUT);
 MotorL.setSpeed(255);
   MotorR.setSpeed(255);

}

void loop() {
 SensorState1 = digitalRead(Sensor1);
 SensorState2 = digitalRead(Sensor2);
 SensorState3 = digitalRead(Sensor3);
 SensorState4 = digitalRead(Sensor4);
 SensorState5 = digitalRead(Sensor5);
 

  
 if (SensorState1 == HIGH) {Serial.print("black1"); Serial.print("  "); }
  if (SensorState1 == LOW){Serial.print("white1");Serial.print("  "); }
 

  if (SensorState2 == HIGH) {Serial.print("black2");  Serial.print("  ");}
  if (SensorState2 == LOW) {Serial.print("white2");Serial.print("  "); }
 
 
  if (SensorState3 == HIGH) {Serial.print("black3"); Serial.print("  "); }
  if (SensorState3 == LOW) {Serial.print("white3"); Serial.print("  ");}
 

  if (SensorState4 == HIGH) {Serial.print("black4"); Serial.print("  "); }
  if (SensorState4 == LOW) {Serial.print("white4"); Serial.print("  ");}
 

  if (SensorState5 == HIGH) {Serial.println("black5");  }
  if (SensorState5 == LOW) {Serial.println("white5"); }


 
 delay(1000);

if (SensorState1 == HIGH) && (SensorState5 == HIGH) && (SensorState2 == HIGH) && (SensorState3 == HIGH)  && (SensorState4 == HIGH)
{
MotorR.run(FORWARD);
   MotorL.run(FORWARD);
 }

else if (SensorState1 == LOW) && (SensorState5 == LOW) && (SensorState2 == HIGH) && (SensorState3 == HIGH)  && (SensorState4 == HIGH)
{ MotorR.run(FORWARD);
   MotorL.run(FORWARD);}
   
   
   else if  (SensorState1 == LOW) && (SensorState5 == LOW) && (SensorState2 == LOW) && (SensorState3 == HIGH)  && (SensorState4 == LOW)
{ MotorR.run(FORWARD);
   MotorL.run(FORWARD);}
   
   
    else if  (SensorState1 == HIGH) && (SensorState5 == LOW) && (SensorState2 == HIGH) && (SensorState3 == HIGH)  && (SensorState4 == LOW)
{ MotorR.run(RELEASE);
   MotorL.run(FORWARD);}
   
    else if  (SensorState1 == LOW) && (SensorState5 == HIGH) && (SensorState2 == LOW) && (SensorState3 == HIGH)  && (SensorState4 == HIGH)
{ MotorR.run(FORWARD);
   MotorL.run(RELEASE);}
   
   }

basically the Errors are:
1-In function 'void loop()':
2- error: expected identifier before '(' token
3- error: expected `;' before '(' token

any help wil be useful

Welcome to the Forum. Please read the two posts

How to use this forum - please read.
and
Read this before posting a programming question ...

at the top of this Forum on guidelines for posting here, especially the use of code tags which make the code look

like this

when posting source code files. It makes it easier to read, and can be copied with a single mouse click. Also, if you don't do it, some of the character sequences in the code can be misinterpred by the forum code as italics or funny emoticons.

Many questions can be answered by simply reading the documentation which is provided with the IDE, available under the help tab, or online here.

If you have already posted without using code tags, open your message and select "modify" from the pull down menu labelled, "More", at the lower left corner of the message. Highlight your code by selecting it (it turns blue), and then click on the "</>" icon at the upper left hand corner. Click on the "Save" button.

There are many other things that programmers do to make their code understandable. Please do them, as a courtesy to the members who volunteer their time to help you here. One is to use a standard indentation to clearly show the code blocks. Never put more than one statement per line. Before posting the code, use Ctrl-T in the IDE to reformat the code in a standard format, which makes it easier for us to read.

'm getting alot of errors

And we've got to guess what they are?

I hate guessing games.

(SensorState1 == HIGH) && (SensorState5 == LOW) && (SensorState2 == HIGH) && (SensorState3 == HIGH)  && (SensorState4 == LOW)

This sort of stuff is a lot easier to code (and read) if you pack the conditions together as a single integer.

thanks guys i did what you said
waiting for help

if (SensorState1 == HIGH) && (SensorState5 == HIGH) && (SensorState2 == HIGH) && (SensorState3 == HIGH)  && (SensorState4 == HIGH)

You have no brackets round the if condition test.

romuo_2007:
thanks guys i did what you said
waiting for help

Help with what? What is wrong? By the way, next time you make changes, post the code again instead of editing the original post. That makes replies seem meaningless or confused.