Skip to content

Instantly share code, notes, and snippets.

@bartenbach
Forked from anonymous/gist:5589817
Created May 16, 2013 06:48
Show Gist options
  • Save bartenbach/5589841 to your computer and use it in GitHub Desktop.
Save bartenbach/5589841 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