josedeschamps_JD-Beard_NewSchool_Processing_github_io/Week7/Homework/2DArray/sketch_2DArray/sketch_2DArray.pde
int COLS_NUM = 100;
int ROWS_NUM = 100;

float[][] posx = new float[COLS_NUM][ROWS_NUM];
float[][] posy = new float[COLS_NUM][ROWS_NUM];


void setup() {
  size(600,600);
  background(0);
  for (int i = 0; i < posx.length; i++) {
    for (int j = 0; j < posx[0].length; j++) {
      posx[i][j] = i * 30;
      posy[i][j] = j * 30;
    
    }
    
    
 
  }

  strokeWeight(5);
  stroke(255);
}

void draw() {
background(0);
  
  for (int i = 0; i < posx.length; i++) {
    for (int j = 0; j < posx[0].length; j++) {
         fill(map(i,0,COLS_NUM,50,255),random(0,255),255);
         rect(posx[i][j], posy[i][j],20,20);
          rect(posx[j][i], posy[j][i],5,5);
      float r = map(i,0,posx.length,0,155);
      float g = map(j,0,posx[0].length,0,255);
      float b = map(dist(mouseX,mouseY,posx[i][j],posy[i][j]),0,200,255,0);
      fill(r,g,b);
      float s = max(map(dist(mouseX,mouseY,posx[i][j],posy[i][j]),0,200,50,10),0);
      rect(posx[i][j], posy[i][j], s,s);
      posx[i][j] += random(-1,1);
      posy[i][j] += random(-1,1);
          
       
        
    }
  }
  
}