xxxxxxxxxx
21
size = 10
var newPicks = []
function setup() {
createCanvas(windowWidth, windowHeight);
newPicks.push(new Toothpick(width / 2, height / 2, true))
}
function draw() {
let newerPicks = []
for (let pick of newPicks) {
pick.show()
let ends = pick.endPoints(newPicks)
for(let end of ends){
newerPicks.push(new Toothpick(end.x, end.y, !pick.isVertical))
}
}
newPicks = newerPicks
}