/** * Tester for the Answer of 2015 #2 where you need to * write the HiddenWord class. * * @author Ethan * @version March 12, 2020 */ public class HiddenWordTester { public static void testGetHint(HiddenWord puzzle, String guess, String expected) { System.out.print("Testing: " + guess +"; "); System.out.println("Should return: " + expected ); String yourCode = puzzle.getHint(guess); System.out.print("\t\tYour Code: " + yourCode); String result = " Fail :("; if (expected.equals (yourCode) ) result = " Pass :)"; System.out.println(result+"\n"); } public static void main(String[] args) { HiddenWord puzzle = new HiddenWord("MOUSE"); System.out.println("Testing getHint Method with the HiddenWord \"MOUSE\" \n"); testGetHint(puzzle, "MOOSE", "MO+SE"); testGetHint(puzzle, "HORNS", "*O**+"); testGetHint(puzzle, "MAYOR", "M**+*"); testGetHint(puzzle, "HOUSE", "*OUSE"); testGetHint(puzzle, "MOURN", "MOU**"); testGetHint(puzzle, "APPLE", "****E"); } }