int gnd[]= {2,3,4,5,6,7,8,9};
int vcc[]= {A3,A2,A1,A0,13,12,11,10};





void setup() {
  // put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);

pinMode(A3, OUTPUT);
pinMode(A2, OUTPUT);
pinMode(A1, OUTPUT);
pinMode(A0, OUTPUT);
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);

digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);

}

void loop() {
  // put your main code here, to run repeatedly:
for(int i=0; i<8; i++){

for(int j=0; j<8; j++){

digitalWrite(gnd[i], LOW);
digitalWrite(vcc[j], HIGH);

delay (20);
digitalWrite(vcc[j], LOW);
digitalWrite(gnd[i], HIGH);

}

}
for(int i=7; i>=0; i--){

for(int j=7; j>=0; j--){

digitalWrite(gnd[i], LOW);
digitalWrite(vcc[j], HIGH);
delay (20);
digitalWrite(vcc[j], LOW);
digitalWrite(gnd[i], HIGH);

}
}



}