// the HumanPlayer asks the user if they want to roll or stay import java.util.Scanner; public class HumanPlayer extends PigPlayer { @Override public boolean rollOrStay(int ourScore, int opponentScore, int roundScore) { System.out.println("You have " + ourScore + " points."); System.out.println("Computer has " + opponentScore + " points."); System.out.println("So far this round you have " + roundScore + " points."); System.out.println("Do you want to roll (Y/N)? "); Scanner in = new Scanner(System.in); String response = in.next(); if (response.equalsIgnoreCase("Y")) { return true; } else if (response.equalsIgnoreCase("N")) { return false; } else { System.out.println("Please enter Y or N."); return rollOrStay(ourScore, opponentScore, roundScore); } } @Override public String getName() { return "You"; } }