xxxxxxxxxx
30
let messages = ['this','that','another thing']; // array
function sayHi() {
print('hi');
}
function say(message) {
print(message);
}
function setup() {
createCanvas(400, 400);
sayHi();
say('great');
let whatToSay = 'not so great';
say(whatToSay);
whatToSay += ' today';
say(whatToSay);
let randomMessage = random(messages); // pick one message
say(randomMessage);
}
function draw() {
background(220);
}