import java.util.Scanner;
import java.util.Random;
public class GeradorDeNumeros {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int numeroCorreto = new Random().nextInt(100);
int chuteDoPlayer = 0;
//System.out.println("Debug: "+numeroCorreto);
for (int i = 4; i >= 0; i--) {
int tentativas = i;
System.out.println("Qual é o seu chute?: ");
chuteDoPlayer = scan.nextInt();
if (chuteDoPlayer > numeroCorreto) {
System.out.println("\nO numero correto é MENOR");
System.out.printf("Você tem mais %d tentativas...", tentativas);
} else if (chuteDoPlayer < numeroCorreto) {
System.out.println("\nO numero correto é MAIOR");
System.out.printf("Você tem mais %d tentativas...", tentativas);
} else {
System.out.printf("\nVocê acertou, o numero era %d", numeroCorreto);
return;
}
}
System.out.println("\n\nAparentemente você falhou. Tente novamente.");
System.out.printf("\nO numero correto era %d. FOI QUASE!!", numeroCorreto);
}
}