minor changes. Still in progress.

This commit is contained in:
Vikram
2019-02-25 19:42:37 -07:00
parent 13f30b681a
commit 461171ff46

View File

@@ -444,6 +444,20 @@ public class Player {
public void gameOver(){
System.out.flush();
System.out.println("Game over");
}
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.");
}
}
}
}