Update Player.java

This commit is contained in:
Vikramb987
2019-02-25 20:19:40 -07:00
committed by GitHub
parent 4aaff2809a
commit 697c221323

View File

@@ -216,19 +216,4 @@ public class Player {
System.exit(0); System.exit(0);
} }
public boolean playAgain(){
Scanner input = new Scanner(System.in);
System.out.println("Would you like to play again? Y/N");
while(true){
String response = input.nextLine();
if(response.equalsIgnoreCase("Y")){
return true;
}else if(response.equalsIgnoreCase("N")){
System.exit(0);
}else{
System.out.println("That is not a valid input.");
}
}
}
} }