xxxxxxxxxx
38
let x = 0;
let y = 0;
let spacing = 50;
let strokeSize = 10;
function setup()
{
createCanvas(windowWidth, windowHeight);
background(0);
}
function draw()
{
//morsePrint(false);
morsePrint(true);
}
function morsePrint(colorize){
push();
if(colorize) stroke(palette.random())
else stroke(255);
strokeWeight(strokeSize);
if(random(1) < 0.5){
point(x+spacing/2,y+spacing);
}
else{
line(x + strokeSize,y + spacing,x + spacing - strokeSize,y + spacing);
}
x += spacing;
if(x > windowWidth) {
x = 0;
y += spacing;
}
pop();
}