I was writing program Hangman and have problem with repeat method
Set<Character> guessed = new HashSet<>();
String word = "_".repeat(wordLength); // it show me mistake here
while (word.contains("_") && guessed.size() != maxGuesses) {
System.out.println("");
System.out.print("Word:");
for (int i = 0; i < word.length(); i++) {
System.out.print(" " + word.charAt(i));
}
System.out.println("");
System.out.println("You have " + (maxGuesses - guessed.size()) + " attempts");
System.out.println("Number of possible words: " + wordsList.size());