xxxxxxxxxx
33
let myTable;
let row = [];
function preload() {
myTable = loadTable('sheet1.csv');
}
function setup() {
createCanvas(400, 400);
textSize(18);
fill(255);
for (let i = 0; i < myTable.getRowCount(); i++) {
row[i] = int(random(myTable.getRowCount()));
print(row[i]);
}
}
function draw() {
background(185, 20, 222);
for (let i = 0; i < myTable.getColumnCount(); i++) {
text(myTable.getString(row[i], i), 50 + (100 * i), height / 2);
}
}
function mousePressed() {
for (let i = 0; i < myTable.getRowCount(); i++) {
row[i] = int(random(myTable.getRowCount()));
print(row[i]);
}
}