Hello, I am creating a game that I have as an exercise, it is to guess the number. The program works perfectly for me, but I need at the end of the game to ask if I want to play another game or not, that is, to come to the beginning of the loop. I do not know how to represent it the truth. . Let's see if you can lend me a hand thanks
import java.util. *;
import java.util.concurrent.ThreadLocalRandom;
public class game {
public static void main(String[] args) {
Scanner entrada=new Scanner(System.in);
System.out.println("Introduce los rangos");
int rango1=entrada.nextInt();
int rango2=entrada.nextInt();
int aleatorio = ThreadLocalRandom.current().nextInt(rango1, rango2 + 1);
int numero=0;
int intentos=0;
while(aleatorio!=numero){
intentos++;
System.out.println("Dime un numero");
numero=entrada.nextInt();
if (numero>100){
}
if (numero>aleatorio){
System.out.println("Mas bajo");
}
if(numero<aleatorio){
System.out.println("Mas alto");
}
if(numero==aleatorio){
System.out.println("Has acertado " + aleatorio);
}
System.out.println("Has necesitado " + intentos + "intentos");
System.out.println("Juego terminado");
} } }
This at the moment we have not yet given it: (