• fullscreen
  • Visualizing_Arrays_Simple.pde
  • float[] randos;
    float[] noisos;
    float xinc;
    void setup() {
      size(500, 300);
      smooth();
      colorMode(HSB, 360, 100, 100);
      randos = new float[100];
      noisos = new float[100];
    
      for (int i=0; i<randos.length; i++) {
        randos[i] = random(100);
      }
      for (int i=0; i<noisos.length; i++) {
        noisos[i] = noise(i/50.0)*100.0;
      } 
      xinc = width / 100.0;
    }
    
    void draw() {
      background(50, 10, 90);
      for (int i=0; i<randos.length; i++) {
        fill(randos[i], 90, 90);
        rect(i*xinc, height/2, xinc, -randos[i]);
        fill(noisos[i], 90,90);
        rect(i*xinc, height-50, xinc, -noisos[i]);
      }
    }
    
    

    code

    tweaks (0)

    about this sketch

    This sketch is running as Java applet, exported from Processing.

    license

    advertisement

    Michael

    Visualizing Arrays [Simple]

    Add to Faves Me Likey@! 1
    You must login/register to add this sketch to your favorites.

    You need to login/register to comment.