Commit c4bb533e authored by ?'s avatar ?
Browse files

Update AnimalGame.java. Doing diagnostic 17.

parent 16b893fa
Showing with 12 additions and 0 deletions
+12 -0
......@@ -25,7 +25,19 @@ def play_until_exit():
again = False
*/
void play_until_exit() {
Scanner scanner = new Scanner(System.in)
boolean again = true;
while (again) {
play_animal_game();
System.out.print("Would you like to play again (y/n)?")
String input = scanner.nextLine()
if (input.toLowerCase().startsWith("n")) {
System.out.println("Goodbye!");
again = false
}
}
scanner.close()
}
double play_5_times() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment