Skip to content

Instantly share code, notes, and snippets.

@tpatel
Created December 28, 2020 20:52
Show Gist options
  • Save tpatel/851fc68d38db10823dc3da286ff7f415 to your computer and use it in GitHub Desktop.
Save tpatel/851fc68d38db10823dc3da286ff7f415 to your computer and use it in GitHub Desktop.
function setup() {
createCanvas(500, 500);
background('#ffffff');
noLoop();
}
function randomLine(x, y, w, h) {
if(Math.random() < 0.5) {
line(x, y, x+w, y+h);
} else {
line(x+w, y, x, y+h);
}
}
function draw() {
strokeWeight(4);
const step = 32;
for(let i=0; i<step; i++) {
for(let j=0; j<step; j++) {
randomLine(i*width/step, j*height/step, width/step, height/step);
}
}
}
@tpatel
Copy link
Author

tpatel commented Dec 28, 2020

tile-lines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment