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all;
int zufallint;
int x = 0;
int y = 0;
int z = 0;





int spirale1[64] = {
  LOW,LOW,LOW,LOW,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,HIGH, 

  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,HIGH, 

  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,HIGH   

  };
 int spirale2[64] = {
  LOW,LOW,LOW,LOW,
  HIGH,HIGH,HIGH,LOW,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,  
  
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,LOW,
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,HIGH, 
    
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,LOW,
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,HIGH, 
  
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,LOW,
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,HIGH
  };    
int spirale3[64] = {
  LOW,LOW,LOW,LOW,
  HIGH,HIGH,HIGH,LOW,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH, 
  
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,LOW,
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,HIGH, 
    
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,LOW,
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,HIGH, 

  HIGH,HIGH,HIGH,HIGH, 
  HIGH,HIGH,HIGH,LOW,
  LOW,LOW,LOW,LOW,
  HIGH,HIGH,HIGH,HIGH
  };  
 int spirale4[64] = {
  LOW,LOW,LOW,LOW,
  HIGH,HIGH,HIGH,LOW,
  HIGH,HIGH,HIGH,HIGH,
  LOW,HIGH,HIGH,HIGH, 
  
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,LOW,
  HIGH,HIGH,HIGH,HIGH,  
  LOW,HIGH,HIGH,HIGH, 
    
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,LOW,
  HIGH,HIGH,HIGH,HIGH,  
  LOW,HIGH,HIGH,HIGH, 
    
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,LOW,
  LOW,LOW,LOW,LOW,
  LOW,HIGH,HIGH,HIGH
  }; 
 int spirale5[64] = {
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,LOW,
  HIGH,HIGH,HIGH,HIGH,
  LOW,HIGH,HIGH,HIGH, 
  
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,LOW,
  HIGH,HIGH,HIGH,HIGH,  
  LOW,HIGH,HIGH,HIGH, 
    
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,LOW,
  HIGH,HIGH,HIGH,HIGH,  
  LOW,HIGH,HIGH,HIGH, 
    
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,LOW,
  LOW,LOW,LOW,LOW,
  LOW,HIGH,HIGH,HIGH
  }; 
    int spirale6[64] = {
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  LOW,HIGH,HIGH,HIGH, 
  
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,  
  LOW,HIGH,HIGH,HIGH, 
    
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,  
  LOW,HIGH,HIGH,HIGH, 
    
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,HIGH,
  LOW,LOW,LOW,LOW,
  LOW,HIGH,HIGH,HIGH
  };   
     int spirale7[64] = {
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  LOW,HIGH,HIGH,HIGH, 
  
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,  
  LOW,HIGH,HIGH,HIGH, 
  
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,  
  LOW,HIGH,HIGH,HIGH, 
    
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,HIGH,
  LOW,HIGH,HIGH,HIGH
  };    
 int spirale8[64] = {
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH, 
  
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,HIGH, 
  
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,HIGH, 
    
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH,  
  HIGH,HIGH,HIGH,HIGH,
  HIGH,HIGH,HIGH,HIGH
  }; 


int schachbrett1[] = {
  LOW,HIGH,LOW,HIGH,
  HIGH,LOW,HIGH,LOW,
  LOW,HIGH,LOW,HIGH,
  HIGH,LOW,HIGH,LOW,
    HIGH,LOW,HIGH,LOW,
  LOW,HIGH,LOW,HIGH,
  HIGH,LOW,HIGH,LOW,
  LOW,HIGH,LOW,HIGH,
    LOW,HIGH,LOW,HIGH,
  HIGH,LOW,HIGH,LOW,
  LOW,HIGH,LOW,HIGH,
  HIGH,LOW,HIGH,LOW,
    HIGH,LOW,HIGH,LOW,
  LOW,HIGH,LOW,HIGH,
  HIGH,LOW,HIGH,LOW,
  LOW,HIGH,LOW,HIGH
  
  };
int schachbrett2[] = {
  HIGH,LOW,HIGH,LOW,
  LOW,HIGH,LOW,HIGH,
  HIGH,LOW,HIGH,LOW,
  LOW,HIGH,LOW,HIGH,
    LOW,HIGH,LOW,HIGH,
  HIGH,LOW,HIGH,LOW,
  LOW,HIGH,LOW,HIGH,
  HIGH,LOW,HIGH,LOW,
    HIGH,LOW,HIGH,LOW,
  LOW,HIGH,LOW,HIGH,
  HIGH,LOW,HIGH,LOW,
  LOW,HIGH,LOW,HIGH,
    LOW,HIGH,LOW,HIGH,
  HIGH,LOW,HIGH,LOW,
  LOW,HIGH,LOW,HIGH,
  HIGH,LOW,HIGH,LOW
  };  
  
  

int L1 = 0;    // Layer 1-4
int L2 = 1;
int L3 = 2;
int L4 = 3;
// LEDs ROT         GRÜN        BLAU
//Reihe A
int rAa = 53; int gAa = 4; int bAa = 20;
int rAb = 51; int gAb = 5; int bAb = 21;
int rAc = 49; int gAc = 6; int bAc = 22;
int rAd = 47; int gAd = 7; int bAd = 24;
//Reihe B
int rBa = 45; int gBa = 8; int bBa = 26;
int rBb = 43; int gBb = 9; int bBb = 28;
int rBc = 41; int gBc = 10; int bBc = 30;
int rBd = 39; int gBd = 11; int bBd = 32;
//Reihe C
int rCa = 37; int gCa = 12; int bCa = 34;
int rCb = 35; int gCb = 13; int bCb = 36;
int rCc = 33; int gCc = 14; int bCc = 38;
int rCd = 31; int gCd = 15; int bCd = 40;
//Reihe D
int rDa = 29; int gDa = 16; int bDa = 42;
int rDb = 27; int gDb = 17; int bDb = 44;
int rDc = 25; int gDc = 18; int bDc = 46;
int rDd = 23; int gDd = 19; int bDd = 48;


void setup() {
  

  pinMode(L1,OUTPUT);
  pinMode(L2,OUTPUT);
  pinMode(L3,OUTPUT);
  pinMode(L4,OUTPUT);
  
  pinMode(rAa,OUTPUT);pinMode(gAa,OUTPUT);pinMode(bAa,OUTPUT);
  pinMode(rAb,OUTPUT);pinMode(gAb,OUTPUT);pinMode(bAb,OUTPUT);
  pinMode(rAc,OUTPUT);pinMode(gAc,OUTPUT);pinMode(bAc,OUTPUT);
  pinMode(rAd,OUTPUT);pinMode(gAd,OUTPUT);pinMode(bAd,OUTPUT);
  pinMode(rBa,OUTPUT);pinMode(gBa,OUTPUT);pinMode(bBa,OUTPUT);
  pinMode(rBb,OUTPUT);pinMode(gBb,OUTPUT);pinMode(bBb,OUTPUT);
  pinMode(rBc,OUTPUT);pinMode(gBc,OUTPUT);pinMode(bBc,OUTPUT);
  pinMode(rBd,OUTPUT);pinMode(gBd,OUTPUT);pinMode(bBd,OUTPUT);
  pinMode(rCa,OUTPUT);pinMode(gCa,OUTPUT);pinMode(bCa,OUTPUT);
  pinMode(rCb,OUTPUT);pinMode(gCb,OUTPUT);pinMode(bCb,OUTPUT);
  pinMode(rCc,OUTPUT);pinMode(gCc,OUTPUT);pinMode(bCc,OUTPUT);
  pinMode(rCd,OUTPUT);pinMode(gCd,OUTPUT);pinMode(bCd,OUTPUT);
  pinMode(rDa,OUTPUT);pinMode(gDa,OUTPUT);pinMode(bDa,OUTPUT);
  pinMode(rDb,OUTPUT);pinMode(gDb,OUTPUT);pinMode(bDb,OUTPUT);
  pinMode(rDc,OUTPUT);pinMode(gDc,OUTPUT);pinMode(bDc,OUTPUT);
  pinMode(rDd,OUTPUT);pinMode(gDd,OUTPUT);pinMode(bDd,OUTPUT);
 

  

  
  }
  

  
    


