Arduino Code for Juggling Machine (Stepper Motors)
Inside loop, you're checking if some code should be run before startup. You could simply move the corresponding code to setup, and be sure it's only run once:
#include &lt;AccelStepper.h&gt;
AccelStepper stepper1(AccelStepper::DRIVER, 9, 8);
AccelStepper stepper2(AccelStepper::DRIVER, 4, 3);

int side = 0;
int max_speed = 6000;
int max_acceleration = 12000;
int stepover = 300;
int step_distance = 800;

void setup() {
  stepper1.setMaxSpeed(max_speed);
  stepper2.setMaxSpeed(max_speed);
  stepper1.setAcceleration(1234);
  stepper2.setAcceleration(1234);
  stepper1.moveTo(600);
  stepper2.moveTo(-200);

  while (abs(stepper1.distanceToGo()) &gt; 0) {
    stepper1.run();
  }
  while (abs(stepper2.distanceToGo()) &gt; 0) {
    stepper2.run();
  }
  stepper1.setAcceleration(max_acceleration);
  stepper2.setAcceleration(max_acceleration);
  delay(500);
}

void loop() {
  // This code moves the left arm
  if (abs(stepper1.distanceToGo()) == 0 and abs(stepper2.distanceToGo()) &lt; stepover and side == 0) {
    stepper1.moveTo(step_distance + stepper1.currentPosition());
    side = 1;
  }

  // This code moves the right arm
  if (abs(stepper2.distanceToGo()) == 0 and abs(stepper1.distanceToGo()) &lt; stepover and side == 1) {
    stepper2.setCurrentPosition(0);
    stepper2.moveTo(step_distance);
    side = 0;
  }

  stepper2.run();
  stepper1.run();
}


abs cannot be negative, so it might be clearer to replace abs(...) != 0 by abs(...) &gt; 0
AccelStepper::move(long relative) is defined as moveTo(_currentPos + relative); so you can probably replace your moveTo by move.