Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(String randomValue=Long.toString(Math.round(Math.random()*100)), numberGuessed, message="";
- !message.equals("YOU WIN!");
- System.out.println("Pick a number from 1 to 100"),
- numberGuessed=(new java.util.Scanner(System.in).nextLine()),
- message = numberGuessed.equals(randomValue) ? "YOU WIN!"
- : Integer.parseInt(numberGuessed)>Integer.parseInt(randomValue) ?
- "Your number is too big!" : "Your number is too small!",
- System.out.println(message)
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement