Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. var num = Randomizer.nextInt(0,100);
  2.  
  3. while(true){
  4. var high = num < guess;
  5. var correct = num == guess;
  6. var low = num > guess;
  7. var done = guess == -1;
  8. var guess = readInt("What is your guess? " );
  9. if(correct){
  10. println("Correct!");
  11. println("Game has concluded.");
  12. break;
  13. }
  14. if(high){
  15. println("Your guess was too high.");
  16. }
  17. if(low){
  18. println("Your guess was too low.");
  19. }
  20. if(done){
  21. println("Game has concluded.");
  22. break;
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement