Week 4

by sherly chen
  • Show Sketch
/** @peep sketchcode */
size(200, 200);
for (int y = 10; y <= height-5; y += 5) {
  for (int x = 10; x <= width-5; x += 5) {
    if (random(1) < 0.5) {
      line (x, y, x+5, y-5); 
    } else {
      line(x, y, x+5, y+5); 
    }
    if (random(1) < 0.5) {
      line(x, y, x-5, y-5); 
    } else {
      line(x, y, x-5, y+5); 
    }
  }
}

Comments

Nobody has said anything yet.