HELP PLS

I had this programming problem when learning arduino. I had a pair of 9 leds connected to the digital pins and want the first and last leds to light up that the next ones and meet at the middle than bump back to the ends again. To overview the 2 edges of my row of less light up than they meet at the middle and go back to the edge again. If it helps it was the second chapter in the book Beginning Arduino by Michael MCRoberts (a exercise). This was my code but it does not work right.

byte ledPin[] = {4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 ,13};
int direction = 1;
int currentLed = 0;
int directionl = -1;
int hi = 9;

void setup() {
  for (int x=0; x < 10 ; x++) {
   
  pinMode(ledPin[x], OUTPUT);
}


}
void loop() {
 delay(250);
    changeLED();

  }

void changeLED() {
for (int x=0; x < 10 ; x++) {
   
  digitalWrite(ledPin[x], LOW);
 
}
 digitalWrite(ledPin[currentLed], HIGH);
 digitalWrite(ledPin[hi], HIGH);
 currentLed += direction;
 hi += directionl;
 if(currentLed== 5){direction== -1;}
  if(currentLed == 0){direction== 1;}
 if(hi== 6){directionl== 1;}
 if(hi== 9){directionl== -1;}
}

when I enter the code my project does what I want it to do but after the first time it lights up random Leds.
PLS HELP and THANKS

Moderator edit: CODE TAGS. What's so difficult?

Please put your code in its own window as seen in other posts. This can be done by placing     [code] and [/code]  around the code. This makes it easier for others to read.

Also please give a meaningful title to the thread. "Help needed" type titles mean nothing to readers.

Weedpharma

int direction = 1;
int currentLed = 0;
int directionl = -1;
int hi = 9;

What are all these for? They don't seem to be used anywhere.

And see how your code should look - without underlines !

...R

I don't see why you're using "hi" and "direction1" - surely "9 - currentLed" is what you want?

    direction== 1;

Oops

PLS help and answer.
Pls I need the answer quick.

Where's your code?
You've been given enough clues to the solution.