import java.util.Set; public class Display { public static void showWord(String word, Set guessedLetters) { StringBuilder sb = new StringBuilder(); for (char c : word.toCharArray()) { if (c == ' ') { sb.append(" "); } else if (guessedLetters.contains(c)) { sb.append(c).append(" "); } else { sb.append("_ "); } } System.out.println(sb.toString()); } public static void showLives(int lives, int maxLives) { System.out.println("Lives: " + lives + " / " + maxLives); } }