Why does this only run one way. Elegoo Most Complete Starter Kit Lesson 30 relay

This appears thaty the dc motor is meant to go one way then reverse for the other way but only seem to get it to turn one way then have big pauses. Any idea why... Eleego most complete starter kit Lesson 30 Relays

//www.elegoo.com
//2016.12.12

/************************
Exercise the motor using
the L293D chip
************************/

#define ENABLE 5
#define DIRA 3
#define DIRB 4

int i;
 
void setup() {
  //---set pin direction
  pinMode(ENABLE,OUTPUT);
  pinMode(DIRA,OUTPUT);
  pinMode(DIRB,OUTPUT);
  Serial.begin(9600);
}

void loop() {
 
//---back and forth example
    Serial.println("One way, then reverse");
    digitalWrite(ENABLE,HIGH); // enable on
    for (i=0;i<5;i++) {
    digitalWrite(DIRA,HIGH); //one way
    digitalWrite(DIRB,LOW);
    delay(750);
    digitalWrite(DIRA,LOW);  //reverse
    digitalWrite(DIRB,HIGH);
    delay(750);
  
  digitalWrite(ENABLE,LOW); // disable
    delay(3000);
      for (i=0;i<5;i++) {
    digitalWrite(DIRA,HIGH); //one way
    digitalWrite(DIRB,LOW);
    delay(750);
    digitalWrite(DIRA,LOW);  //reverse
    digitalWrite(DIRB,HIGH);
    delay(750);
  }
    digitalWrite(ENABLE,LOW); // disable
    delay(3000);
}
   }

That circuit just uses the L293 as a relay driver to turn the motor on and off so the code is not for that circuit.

In order to reverse the motor rotation you must reverse the voltage across the motor. The motor goes to ground on one side so there is no way to reverse the voltage. Maybe one of the next lessons shows how to wire the motor and L293 properly for bi-directional motor control as in the sketch.