xxxxxxxxxx
31
var words = ["number", "element", "value", "slider", "minimum"];
var index = 0;
function setup() {
createCanvas(windowWidth, 100);
textAlign(CENTER);
}
function windowResized() {
resizeCanvas(windowWidth, 100);
}
function draw() {
background('red');
fill(255);
textSize(32);
text(words[index], width/2, height/2);
}
function mousePressed() {
index = floor(random(words.length));
console.log(index);
if (index == words.length) {
index = 0;
}
}