My first real RC truck project LED Arduino

ok here is the code i would like to see made in to functions. Please like i said im very new at this so no half cods or un checked codes. If you post it, make sure it works first. also please // and tell what each line of code dose. Thank you and if you need any more info please let me know.

int timer = 100;                   // The higher the number, the slower the timing.
int pins[] = { 2, 3, 4, 5, 6, 7 }; // an array of pin numbers
int num_pins = 6;                  // the number of pins (i.e. the length of the array)

void setup()
{
  int i;

  for (i = 0; i < num_pins; i++)   // the array elements are numbered from 0 to num_pins - 1
    pinMode(pins[i], OUTPUT);      // set each pin as an output
}

void loop()
{
  int i;

  for (i = 0; i < num_pins; i++) { // loop through each pin...
   
  }
  
    
//turn right
digitalWrite(pins[3], HIGH);
delay(100);
digitalWrite(pins[4], HIGH);
delay(100);
digitalWrite(pins[5], HIGH);
delay(100);

digitalWrite(pins[3], LOW);
delay(100);
digitalWrite(pins[4], LOW);
delay(100);
digitalWrite(pins[5], LOW);
delay(100);
digitalWrite(pins[3], HIGH);
delay(100);
digitalWrite(pins[4], HIGH);
delay(100);
digitalWrite(pins[5], HIGH);
delay(100);

digitalWrite(pins[3], LOW);
delay(100);
digitalWrite(pins[4], LOW);
delay(100);
digitalWrite(pins[5], LOW);
delay(100);
//turn left
digitalWrite(pins[2], HIGH);
delay(100);
digitalWrite(pins[1], HIGH);
delay(100);
digitalWrite(pins[0], HIGH);
delay(100);
digitalWrite(pins[2], LOW);
delay(100);
digitalWrite(pins[1], LOW);
delay(100);
digitalWrite(pins[0], LOW);
delay(100);
digitalWrite(pins[2], HIGH);
delay(100);
digitalWrite(pins[1], HIGH);
delay(100);
digitalWrite(pins[0], HIGH);
delay(100);
digitalWrite(pins[2], LOW);
delay(100);
digitalWrite(pins[1], LOW);
delay(100);
digitalWrite(pins[0], LOW);
delay(100);




  }

Thank you