import java.awt.Color; import java.util.Scanner; public class WordelColorTester { public static void main(String[] args) { Wordel word = new Wordel(); Scanner kb = new Scanner(System.in); System.out.println(" Diagnostic: The answer is " + word); System.out.print(" Type a 5 letter guess to see the color clues: "); String guess = kb.nextLine().toUpperCase(); while (!(guess.length() == 5) ) { System.out.print(" Type a 5 letter guess to see the color clues: "); guess = kb.nextLine().toUpperCase(); } String clue = ""; for(int i = 0; i < 5; i++) { Color c = word.getLetterColor(i, guess) ; if (c.equals(Color.GREEN)) clue += "G"; if (c.equals(Color.YELLOW)) clue += "Y"; if (c.equals(Color.BLACK)) clue += "B"; } System.out.println(guess + "\r" + clue); } }