Hi Everyone,
So I just ran the application which determines order for the final presentations. Here is the output:
0: Rediet D. and Sara H. 4 4.8509746
1: Nahla I. 2 2.3797078
2: Oleg P. and James H. 3 3.1255593
3: Kharisa R. 0 0.31645668
4: Kun L. and Wei-Chung L. 1 1.3669138
5: Supatra L. 5 5.229145
Done
For reference, here is the app:
String[] student = {
"Kharisa R.",
"Kun L. and Wei-Chung L.",
"Nahla I.",
"Oleg P. and James H.",
"Rediet D. and Sara H.",
"Supatra L."
};
int[] choosen = new int[student.length];
void setup() {
for (int c = 0; c < choosen.length; c++) {
choosen[c] = -1;
}
for (int i = 0; i < student.length; i++) {
float choicef = random(0,student.length);
int choice = floor(choicef);
while (true) {
boolean good = true;
for (int c = 0; c < choosen.length && good; c++) {
if (choosen[c] == choice) {
good = false;
}
}
if (good) {
break;
} else {
choicef = random(0,student.length);
choice = floor(choicef);
}
}
choosen[i] = choice;
println("" + i + ": " + student[choice] + " " + choice + " " + choicef);
}
println("Done");
}