Guest User

Untitled

a guest
Jul 15th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. /**
  2. * Play Another Game?
  3. *
  4. * @return True: Again; False: End Program;
  5. *
  6. */
  7. public boolean playAgain()
  8. {
  9. while(true)
  10. {
  11. System.out.print("Would you like to play again? (y/n): ");
  12. String s = in.next();
  13.  
  14. if((s == "y") || (s == "Y") || (s == "n") || (s == "N"))
  15. {
  16. if((s == "n") || (s == "N"))
  17. return false;
  18.  
  19. newGame();
  20. return true;
  21. }
  22. }
  23. }
Add Comment
Please, Sign In to add comment