斜め線
/** * slanting lines * * @author aa_debdeb * @date 2016/08/21 */ float e = 2; void setup(){ size(500, 500); noStroke(); mousePressed(); } void draw(){} void mousePressed(){ background(random(255), random(255), random(255)); fill(random(255), random(255), random(255)); boolean[] rule = new boolean[20]; for(int i = 0; i < 20; i++){ rule[i] = random(1) < 0.5; } for(int x = 0; x * e < width; x++){ for(int y = 0; y * e < height; y++){ if(rule[(x + y) % 20]){ rect(x * e, y * e, e, e); } } } }