My goal with the code was to set up a game that asked the person which number the computer would be "thinking" (from 1 to 100), and as the person said a number from 1 to 100, the computer would tell if the random number generated is greater or less than what the person typed until it was successful.
However, when I run the program, it loops with "Guess the number".
Random rand = new Random();
int numSorte = rand.nextInt(100) + 1;
System.out.println("Adivinhe o número que estou pensando,ele está entre 1 e 100");
boolean continuar = true;
Scanner scan = new Scanner(System.in);
while(continuar = true) {
System.out.println("Adivinhe o número :");
}
int numUsuario = Integer.valueOf(scan.next());
if(numUsuario == numSorte) {
System.out.println("VOCÊ GANHOU!!!!!!");
continuar = false;
}
else if(numUsuario < numSorte) {
System.out.println("O número" + numUsuario + "é menor do que o número sorteado");
}
else {
System.out.println("O número" + numUsuario + "é maior do que o número sorteado");
}
scan.close();