What's wrong with my codes/
I changed it, so it at least compiles.
int ledPins[]={3,4,5,6,7,8,9,10,11,12};
void setup()
{
  for(int i=0; i &lt; 11; i++)
  {
    pinMode(ledPins[i],OUTPUT);
  }
}

void loop()
{
  int i = 0;
  while (i &lt; 10)
  {
    digitalWrite(ledPins[i],HIGH);
    delay(100);
    digitalWrite(ledPins[i],LOW);
    i++;
  }
  i = 10;
  while (i &gt; 0)
  {
    digitalWrite(ledPins[i],HIGH);
    delay(100);
    digitalWrite(ledPins[i],LOW);
    i--;
  }
}