Skip to content

Instantly share code, notes, and snippets.

Created May 16, 2013 06:42
Show Gist options
  • Save anonymous/5589817 to your computer and use it in GitHub Desktop.
Save anonymous/5589817 to your computer and use it in GitHub Desktop.
Scanner scn = new Scanner(System.in);
System.out.println("Want to play again? (y/n)");
String in;
do (in = scn.next()) {
System.out.println("Enter y for yes, or n for no:")
} (while in.equalsIgnoreCase("y") || in.equalsIgnoreCase("n"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment