int ancho=400,alto=300; FloatMatriz actual=new FloatMatriz(ancho,alto); FloatMatriz anterior=new FloatMatriz(ancho,alto); float relacion_con_la_vecindad(FloatMatriz ante, boolean mouseClick){ float valor; //-------------------------------------------------------------------------------------------------------------------------------- // INICIO de codigo a modificar - INICIO de codigo a modificar - INICIO de codigo a modificar - INICIO de codigo a modificar - //-------------------------------------------------------------------------------------------------------------------------------- int margen=0; if(mouseClick){ margen=2; } valor = ( ante.n()+ante.ne()+ante.e()+ante.se()+ante.s()+ante.so()+ante.o()+ante.no() ) / 8; if(valor > 255-margen){ valor = 100; }else if(valor < margen){ valor = 150; }else{ valor= (valor>=random(50,205) ? 255 : 0); } //-------------------------------------------------------------------------------------------------------------------------------- // FIN de codigo a modificar - FIN de codigo a modificar - FIN de codigo a modificar - FIN de codigo a modificar - //-------------------------------------------------------------------------------------------------------------------------------- return valor; } void setup(){ size(800,600); actual.iniciarAzar(0,255); noStroke(); //framerate(2); } void loop(){ float pasoAncho = width/ancho; float pasoAlto = height/alto; for(int i=0;i0){ return this.read(px,py-1); }else{ return this.read(px,fil-1); } } float s(){ if(py0){ return this.read(px-1,py); }else{ return this.read(col-1,py); } } float e(){ if(px0){ if(px>0){ return this.read(px-1,py-1); }else{ return this.read(col-1,py-1); } }else{ if(px>0){ return this.read(px-1,fil-1); }else{ return this.read(col-1,fil-1); } } } float ne(){ if(py>0){ if(px0){ return this.read(px-1,py+1); }else{ return this.read(col-1,py+1); } }else{ if(px>0){ return this.read(px-1,0); }else{ return this.read(col-1,0); } } } float se(){ if(py