- size(400,400);
- line(40,40,40,360);
- line(40,360,360,360);
- int px0 = 40;
- int py1 = 0;
- int py2 = 0;
- int pa[] = {250,190,124,116,90,115,200,180,76,190,115, 189, 215, 50, 170, 125};
- int pb[] = {300,234,250,260,210,205,260,276,290,310,267, 280, 290, 293, 299, 330};
- for(int x = 0; x < 16; x++) {
- stroke(0);
- fill(0);
- line(38, 340 - (x * 20),40,340 - (x * 20));
- text(20 + (x * 20), 15, 343 - (x * 20));
- line(60 + (20 * x), 362, 60 + (20 * x), 360);
- text(x + 1, 57 + (20 * x), 380);
- if(py1 > 0) {
- fill(125,0,0);
- stroke(125,0,0);
- beginShape();
- vertex(px0, py1);
- vertex(px0 + 20, pa[x]);
- vertex(px0 + 20, 360);
- vertex(px0, 360);
- endShape(CLOSE);
- fill(0,125,0);
- stroke(0,125,0);
- beginShape();
- vertex(px0, py2);
- vertex(px0 + 20, pb[x]);
- vertex(px0 + 20, 360);
- vertex(px0, 360);
- endShape(CLOSE);
- px0 += 20;
- }
- py1 = pa[x];
- py2 = pb[x];
- }
- save("activity14.png");