Hi, I’m new to Processing, I’m making a 3x3 grid game that makes users mousehover over to a target square that is one of the 9 squares. I’m trying to create a function called getNextSquare that picks a random number between 1 and 9 to be the target that that loops again if it picks the number(square) previously clicked by the user to pick a number (square) that wasn’t picked before.
Any help would be vastly appreciated. Here’s my code.
int nextSquare = 0;
void setup() {
size(400,400);
nextSquare = 0;
}
void getNextSquare() {
for (int nextSquare = 0; nextSquare < 10; nextSquare++) {
float r = random(1, 9);
println(r);
}
}