Discuss Scratch

PenguinLover1123
Scratcher
1000+ posts

Try this in ProcressingJS (I recommend khan academy's version with 600 width and height)

var res = 1;//Increase this if a "loop is taking too long" error happens
if (res < 1) {
    res = 1;
}
strokeWeight(res);
background(255,255,255);
for (var y = 0; y < height; y += res) {
for (var x = 0; x < width; x += res) {
    stroke((y + (sin(x)*50))%y);//Change "sin" to "" or "cos" or any other trig function
    point(x,y);
}
}

Last edited by PenguinLover1123 (Sept. 12, 2021 14:43:44)


Good morning/afternoon/night

Powered by DjangoBB