1m neopixel strip coding help

I'm sure there are much more elegant ways to do this, but I've never been really good at trying to follow someone else's logic. Probably cause I'm so damn illogical. :smiley: But it seems to work. Try it out and see. All I did really was comment out the line I told you about yesterday, and added a variable for the other side that get's incremented along with the loop. And played with the numbers some. One thing to keep in mind is the first pixel is zero. So on a 30 pixel strip the max value is 29, not 30. So one must be careful when you choose equal to or greater than. And honestly, I'm not sure that was an issue, I just played with the numbers till it looked right.

Edit: I made the delay time much shorter so I didn't have to wait as long to see if it works, so you might want to change that back. It's been running for about a half hour now, and no glitches that I've seen.

#include <Adafruit_NeoPixel.h>

#define PIN 6
int direction=1;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(30, PIN, NEO_GRB + NEO_KHZ800);





int r =0;
int x = 30;
int d = 10;

void setup() {
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}





void loop() {
  int b=15;
 
     for (int z = 14, y = 15; z<x, y>r; z++, y--) {
   
     
       
    //  strip.setPixelColor(z, 0, 63, 0);
    strip.setPixelColor(y, 0, 63, 0);
   

     strip.show();delay(d);delay(d);
      strip.setPixelColor(b, 0, 63, 0);
     strip.setPixelColor(z, 0, 0, 0);
     
     b++;
    
   
  strip.setPixelColor(y, 0, 0, 0);
    strip.show();


      
   }
 strip.setPixelColor(r, 0, 63, 0);
// strip.setPixelColor(x, 0, 63, 0);
 strip.show();

 x--;
 r++;

 
if (x<14) {
   x=29;
 }

 if (r>57) {
  r=0;
 }
 delay(d);
 
/*   
   for (int y = 14; y>r; y--) {
     strip.setPixelColor(y, 0, 63, 0);
     strip.show(); delay(d);delay(d);
     strip.setPixelColor(y, 0, 0, 0);
     strip.show();
   }

 strip.setPixelColor(r, 0, 63, 0);
 
 r++;
 if (r>=15) {
   r=0;
 }
 */
   }