xxxxxxxxxx
25
var numbers = [];
function setup() {
createCanvas(400, 400);
colorMode(HSB,100);
for (let i = 0; i < 100; i++) numbers.push(i);
print("click on canvas and use key 's' for shuffle");
}
function draw() {
translate(width/2,height/2);
background(100);
for ( let i = 0 ; i < 1000 ; i++ ) {
push();
rotate(TAU*i/1000);
var c = color(numbers[(int)(i/10.0)],100,100);
stroke(c);
line(0,0,100,0);
pop();
}
}
function keyPressed() {
if ( key == 's' ) shuffle(numbers,true);
}