int leds[] = {23, 22, 21, 19, 18, 17};
void setup() {
  for (int i = 0; i <= 5; i++) {
    pinMode(leds[i], OUTPUT);
    digitalWrite(leds[i], LOW);
  }
}

void loop() {
  for (int i = 0; i <= 5; i++) {
    digitalWrite(leds[i], HIGH);
    delay(500);
    digitalWrite(leds[i], LOW);
    delay(500);
  }
  for (int i = 5; i >= 0; i--) {
    digitalWrite(leds[i], HIGH);
    delay(500);
    digitalWrite(leds[i], LOW);
    delay(500);
  }

  delay(2000);

  for (int i = 2; i >= 0; i--) {
    digitalWrite(leds[i], HIGH);
    digitalWrite(leds[5 - i], HIGH);
    delay(500);
    digitalWrite(leds[i], LOW);
    digitalWrite(leds[5 - i], LOW);
    delay(500);
  }

  for (int i = 0; i <= 2; i++) {
    digitalWrite(leds[i], HIGH);
    digitalWrite(leds[5 - i], HIGH);
    delay(500);
    digitalWrite(leds[i], LOW);
    digitalWrite(leds[5 - i], LOW);
    delay(500);
  }

  delay(2000);

  for (int i = 0; i <= 5; i++) {
    digitalWrite(leds[i], HIGH);
    delay(500);
  }
  for (int i = 5; i >= 0; i--) {
    digitalWrite(leds[i], LOW);
    delay(500);
  }

  delay(2000);
}