Facebook
From Evangelos Nikolaou, 2 Weeks ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 85
  1. size(400,400);
  2.  
  3. line(40,40,40,360);
  4. line(40,360,360,360);
  5.  
  6.  
  7. int px0 = 40;
  8. int py1 = 0;
  9. int py2 = 0;
  10.  
  11. int pa[] = {250,190,124,116,90,115,200,180,76,190,115, 189, 215, 50, 170, 125};
  12. int pb[] = {300,234,250,260,210,205,260,276,290,310,267, 280, 290, 293, 299, 330};
  13.  
  14. for(int x = 0; x < 16; x++) {
  15.   stroke(0);
  16.   fill(0);
  17.   line(38, 340 - (x * 20),40,340 - (x * 20));
  18.   text(20 + (x * 20), 15, 343 - (x * 20));
  19.  
  20.   line(60 + (20 * x), 362, 60 + (20 * x), 360);
  21.   text(x + 1, 57 + (20 * x), 380);
  22.  
  23.   if(py1 > 0) {
  24.      fill(125,0,0);
  25.      stroke(125,0,0);
  26.      
  27.      beginShape();
  28.      vertex(px0, py1);
  29.      vertex(px0 + 20, pa[x]);
  30.      vertex(px0 + 20, 360);
  31.      vertex(px0, 360);
  32.      endShape(CLOSE);
  33.    
  34.      fill(0,125,0);
  35.      stroke(0,125,0);
  36.      beginShape();
  37.      vertex(px0, py2);
  38.      vertex(px0 + 20, pb[x]);
  39.      vertex(px0 + 20, 360);
  40.      vertex(px0, 360);
  41.      endShape(CLOSE);
  42.      
  43.      px0 += 20;
  44.   }
  45.   py1 = pa[x];
  46.   py2 = pb[x];  
  47. }
  48.  
  49. save("activity14.png");
  50.