xxxxxxxxxx
17
function setup() {
createCanvas(400, 400);
// Get a random element from an array using the random(Array) syntax
let words = ['apple', 'bear', 'cat', 'dog'];
let word = random(words); // select random word
text(word, 10, 50); // draw the word
describe(`word displayed at random. Either apple, bear, cat, or dog.`);
}
function draw() {
background(220);
}