xxxxxxxxxx
60
let names = [
"Rumik Zoey",
"Emily",
"Jacenia",
"Matthew",
"Shannon",
"Harry",
"Olive",
"May",
" Mickey",
"Matt",
"Queenie Christina Jess",
"Alina / David"
];
let y;
let counter = 0;
let tsz = 36;
let pefamount=1;
let order = [];
let labeloffset = 1.05;
let g1 = "Group: 1 Monday";
let g2 = "Group: 2 Wednesday";
function setup() {
createCanvas(windowWidth, windowHeight);
pefamount = round(names.length/2);
console.log(pefamount)
console.log("total performances: "+ names.length)
}
function draw() {
background(255, 255, 0);
textSize(tsz);
for (let i = 0; i < order.length; i++) {
text(order[i], 20, 50 + (i * tsz));
}
textSize(tsz/labeloffset);
text(g1, width - textWidth(g1)-70, tsz/labeloffset);
stroke(255, 0, 0);
strokeWeight(2)
line(0, (pefamount * tsz) + (tsz / 2), width, (pefamount * tsz) + (tsz / 1.8));
noStroke();
text(g2, width - textWidth(g2)-70,((pefamount+1) * tsz) + (tsz / 2.5));
}
function mousePressed() {
let pair = [];
if (names.length > 0) {
let ind = floor(random(names.length));
order[counter] = names[ind];
names.splice(ind, 1);
}
console.log(order[counter]);
counter++;
}