I am running the following code to get random (x, y) coordinate pairs. However, I only get the same pair over and over again.
int counter=0;
while(counter<20){
x3=(int)Math.random()*831+50;
y3=(int)Math.random()*381+50;
canvas.setColor(Color.white);
canvas.drawString("*", x3, y3);
counter++;
}
I am very new to Java, so please tell me a simple way I could fix this. Thank you!