Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int step = 80;
- void setup() {
- size(800, 640);
- background(255);
- strokeCap(SQUARE);
- drawGrid();
- }
- void draw() {
- }
- void mouseClicked() {
- setup();
- }
- void keyPressed() {
- save(random(1234)+".png");
- }
- void drawGrid() {
- for (int x=step; x<width; x += step) {
- for (int y=step; y<height; y += step) {
- noFill();
- int c = 0;
- strokeWeight(step/4);
- for (int i=0; i<4; i++) {
- float r = random(1);
- if (r > .25) {
- stroke(0);
- c++;
- }
- else {
- noStroke();
- }
- arc(x, y, step, step, (i*PI/2)-0.01, ((i+1)*PI/2)+0.01);
- if (c==4) {
- fill(200);
- strokeWeight(3);
- //ellipse(x, y, step*.75, step*.75);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement