i am using this code to select a number randomly from a range of numbers -
Random rand = new Random();
int upperBound = 26;
int alphabet_rand = rand.nextInt(upperBound);
So , i know what this will do , but lets say a add a button using which i want to refresh its value , how can i do that so that it changes its value to something else in the range at the click of a button . Assume that i already have a script for the Frontend of this. Edit:In future i will be using 3 such variables ... i have an array with 26 strings.I want to select any 3 strings from them randomly and refresh the 3 if any button is pressed , so i want the random number to be changed when i click the button.
Aucun commentaire:
Enregistrer un commentaire