10 Led's different programs after eachother Error!

hello,

I have a Arduino Uno and i want to run on 10 Led's different programs, but i have make a program and it run.. but after a few minutes some leds errors or go on when they shouldn't go on.
I use 10 LED on PIN 2 to 11.

I want to make 10 leds that does different things after 5 time they repeat. See my program:

#include <stdlib.h>
#include <unistd.h>

int SequentialRunCount = 0;
int FollowUpRunCount = 0;
int FlashyRunCount = 0;

int pinArray[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
int odd[] = {3, 5, 7, 9, 11};
int even[] = {2, 4, 6, 8, 10};

void setup() {
  for(int i = 0; i < sizeof(pinArray); i++) {
    pinMode(pinArray[i], OUTPUT);
  }
}

void sequential() {
  for(int i = 0; i < sizeof(pinArray); i++) {
    digitalWrite(pinArray[i], HIGH);
    delay(50);
  }
  for(int i = 10; i >= 0; i--) {
    digitalWrite(pinArray[i], LOW);
    delay(50);
  }
  delay(50);
}

void first() {
  for(int i = 10; i >= 0; i--) {
    digitalWrite(pinArray[i], HIGH);
    delay(50);
  }
  for(int i = 0; i < sizeof(pinArray); i++) {
    digitalWrite(pinArray[i], LOW);
    delay(50);
  }
  delay(50);
}

void follow() {
  for(int i = 0; i < sizeof(pinArray); i++) {
    if(i > 1 && i <= 10) {
      digitalWrite(pinArray[i], HIGH);
      digitalWrite(pinArray[i - 2], LOW);
      delay(100);
    } else if(i == 0 || i == 1) {
      digitalWrite(pinArray[i], HIGH);
      delay(100);
    }
  }

  for(int i = 0; i < sizeof(pinArray); i++){
    digitalWrite(pinArray[i], LOW);
  }
}

void followReverse() {
  for(int i = sizeof(pinArray) - 1; i >= 0; i--) {
    if(i < 9 && i >= 0) {
      digitalWrite(pinArray[i], HIGH);
      digitalWrite(pinArray[i + 2], LOW);
      delay(100);
    } else if(i == 10 || i == 9) {
      digitalWrite(pinArray[i], HIGH);
      delay(100);
    }
  }

  for(int i = 0; i < sizeof(pinArray); i++){
    digitalWrite(pinArray[i], LOW);
  }
}

void followUp() {
  digitalWrite(odd[0], HIGH);
  digitalWrite(odd[1], HIGH);
  digitalWrite(odd[2], HIGH);
  digitalWrite(odd[3], HIGH);
  digitalWrite(odd[4], HIGH);
  delay(500);
  digitalWrite(odd[0], LOW);
  digitalWrite(odd[1], LOW);
  digitalWrite(odd[2], LOW);
  digitalWrite(odd[3], LOW);
  digitalWrite(odd[4], LOW);
  digitalWrite(even[0], HIGH);
  digitalWrite(even[1], HIGH);
  digitalWrite(even[2], HIGH);
  digitalWrite(even[3], HIGH);
  digitalWrite(even[4], HIGH);
  delay(500);
  digitalWrite(even[0], LOW);
  digitalWrite(even[1], LOW);
  digitalWrite(even[2], LOW);
  digitalWrite(even[3], LOW);
  digitalWrite(even[4], LOW);
}

void endSequence() {
  delay(400);
  for(int i = 0; i < sizeof(pinArray); i++){
    digitalWrite(pinArray[i], HIGH);
  }
  delay(400);
  for(int i = 0; i < sizeof(pinArray); i++){
    digitalWrite(pinArray[i], LOW);
  }
}

void loop() {
  delay(200);
  for(int i = 0; i < 3; i++) {
    follow();
  }
  for(int i = 0; i < 3; i++) {
    first();
  }
  for(int i = 0; i < 3; i++) {
    followUp();
  }
  for(int i = 0; i < 3; i++) {
    sequential();
  }
  for(int i = 0; i < 3; i++) {
    followReverse();
  }
  for(int i = 0; i < 4; i++) {
    endSequence();
  }
  asm volatile ("  jmp 0");  
  }

If i change the 3 time repeat in 5 or 7 then it crash, and after running this program Pin 8 / 11 works not right (read Led 7 / 10) .
If i change the time the last program will run cotinue or program 2..
See photo for setup,

Can someone tell me what i do wrong or what the solution is?

int pinArray[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
  for (int i = 0; i < sizeof(pinArray); i++)

Each entry in pinArray is an int. An int takes 2 bytes of storage so sizeof(pinArray) is 20

Can you see a problem ?

To get the number of entries in an array of any kind use

sizeof(pinArray) / sizeof(pinArray[0])

instead of repeatedly using sizeof() in each loop, it would be better to use a #define

#define PinArraySize (sizeof(pinArray)/sizeof(int))

for (int i = 0; i < PinArraySize; i++)
...

Note that in an array of 10 elements, the elements are numbered 0 through 9.

Here you are starting off the end of the array:

  for(int i = 10; i >= 0; i--) {
    digitalWrite(pinArray[i], LOW);
    delay(50);
  }

Thanks for quik response! Arduino is new for me.. i will try your solutions

and .....You should have series resistors for use with the leds - without them you can overload the board with such a large number .

Try 270ohm.