Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- do{
- System.out.print("Votre choix: ");
- nombre_choisi = lecture_nombre.nextInt();
- System.out.println();
- if(nombre_choisi> limite_max || nombre_choisi < limite_min){
- System.out.println("--- Hors limite ---");
- System.out.println();
- nombre_essai++;
- }
- else if(nombre_choisi > ChiffreCache && (nombre_choisi < limite_max && nombre_choisi > limite_min)){
- System.out.println("--- Trop grand ---");
- System.out.println();
- nombre_essai++;
- }
- else if(nombre_choisi < ChiffreCache && (nombre_choisi < limite_max && nombre_choisi > limite_min)){
- System.out.println("--- Trop petit ---");
- System.out.println();
- nombre_essai++;
- }
- }while(nombre_choisi != ChiffreCache);
- System.out.println("--- Bravo... Trouvé en " + nombre_essai + " coups");
- System.out.println();
- return nombre_essai;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement