import java.io.BufferedReader; import java.io.IOException; /** * Keeps track of the history of the game and well as the clearing * the screen and prompting the user to play again * * @author Andrew Szatkowski * @version 1.0 */ public class Mastermind { /** * Constructs an instance of the class initializing * all instance fields to default values * * @param the total number of turns allowed the player */ public Mastermind(int turns) { guess = new String[turns]; resultBlack = new int[turns]; resultWhite = new int[turns]; } /** * Clears the terminal window */ public void clearScreen() { System.out.print('\u000C'); } /** * Stores the guess history into an array * * @param the current turn the player is on * the guess the player made */ public void setGuessHistory(int location, String input) { guess[location] = input; } /** * Stores the number of blacks each guess scored * * @param the current turn the player is on * the number of blacks scored */ public void setBlackHistory(int location, int black) { resultBlack[location] = black; } /** * Stores the number of whites each guess scored * * @param the current turn the player is on * the number of whites scored */ public void setWhiteHistory(int location, int white) { resultWhite[location] = white; } /** * Prints out the history up to the players turn * * @param the current turn */ public void printHistory(int round) { for(int i=0; i