xxxxxxxxxx
23
let r;
function setup() {
createCanvas(400, 400);
r = floor(random(1, 100));
}
function draw() {
background(255);
noStroke();
fill(0);
textSize(100);
textAlign(CENTER, CENTER);
text(r, width / 2, height / 2);
textSize(30);
text("Random Number Generator", width / 2, 100);
}
function keyPressed() {
if (key == " ") {
r = floor(random(1, 100));
}
}