Hangman display found letter
<p>I am currently coding a hangman console game in java and have had no problems so far. </p>

<p>I have now come across a problem I can not seem to solve. </p>

<p>I have arrays of different words easy, medium and hard and get a word from them randomly depending on the difficulty chosen. I then convert that word into *'s so that the player can't see the characters. </p>

<p>The user is then asked for letters and the program informs the user if they are right or wrong. But the issue is that I can not seem to change the * to the letter if it is in the word. So for example if the word was "bee" and the player picked b I'd want <strong>* to change to b</strong>. </p>

<p>Could anyone help point me in the right direction?</p>

<p>Hangman class:</p>

<pre><code>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hangman;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import java.util.Scanner;

/**
 *
 * @author Adam2_000
 */
public class Hangman {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {


        String player = "";
        String selection;
        int turn = 12;
        List&lt;String&gt; wordBox = new ArrayList&lt;String&gt;();
        boolean hangman = false;
        Scanner scan = new Scanner(System.in);

        //New instances of class and arrays
        words words = new words();
        String easyWords1[] = words.easyWords;
        String mediumWords1[] = words.mediumWords;
        String hardWords1[] = words.hardWords;
        Random random = new Random();


        System.out.println("Welcome to Hangman version 1");
        System.out.println("Please choose a difficulty");
        System.out.println("A: Easy");
        System.out.println("B: Medium");
        System.out.println("C: Hard");

        System.out.println(" _________     ");
        System.out.println("|         |    ");
        System.out.println("|         0    ");
        System.out.println("|        /|\\  ");
        System.out.println("|        / \\  ");
        System.out.println("|              ");
        System.out.println("|              ");


        char iChoice;

        do {
            selection = scan.nextLine().toUpperCase();
        } while (selection.isEmpty());
        iChoice = selection.charAt(0);
        if (iChoice != 'X') {
            switch (iChoice) {

                case 'A':
                    System.out.println("You have choosen easy:");
                    //Get and print random string from easyWords                   
                    int selectA = random.nextInt(easyWords1.length);
                    String replaceAllEasy = easyWords1[selectA].replaceAll("\\S", "*");
                    // Print the randomly selected word and its length
                    System.out.println("Random String selected: " + replaceAllEasy);
                    System.out.println("This word contains " + easyWords1[selectA].length() + " letters");

                    //while hangman == false continue to ask player for letters
                    while (hangman == false) {
                        System.out.println("Turns remaining: " + turn);
                        System.out.println("Please choose a letter A-Z :");
                        String easyChosenLetter = scan.next();

                        if (wordBox.contains(easyChosenLetter)) {
                            System.out.println("Letter alreay choosen please choose another letter");
                        } else {
                            wordBox.add(easyChosenLetter);
                        }

                        if (easyWords1[selectA].contains(easyChosenLetter)) {

                            System.out.println("Wordbox letters are: " + wordBox);
                            System.out.println("Yes!");
                            turn--;
                        } else {
                            System.out.println("Wordbox letters are: " + wordBox);
                            System.out.println("No!");
                            turn--;
                        }

                        if (turn == 0) {
                            hangman = true;
                        }

                        while (hangman == true) {
                            System.out.println("You lose!");
                            System.exit(0);
                        }

                    }
                    break;

                case 'B':
                    System.out.println("You have choosen Medium");
                    //Get and print random string from mediumWords
                    int selectB = random.nextInt(mediumWords1.length);
                    String replaceAllMedium = mediumWords1[selectB].replaceAll("\\S", "*");
                    // Print the randomly selected word and its length
                    System.out.println("Random String selected: " + replaceAllMedium);
                    System.out.println("This word contains " + mediumWords1[selectB].length() + " letters");

                    //while hangman == false continue to ask player for letters
                    while (hangman == false) {
                        System.out.println("Turns remaining: " + turn);
                        System.out.println("Please choose a letter A-Z :");
                        String mediumChosenLetter = scan.next();

                        if (wordBox.contains(mediumChosenLetter)) {
                            System.out.println("Letter alreay choosen please choose another letter");
                        } else {
                            wordBox.add(mediumChosenLetter);
                        }

                        wordBox.add(mediumChosenLetter);
                        if (easyWords1[selectB].contains(mediumChosenLetter)) {
                            System.out.println("Wordbox letters are: " + wordBox);
                            System.out.print("Yes!");
                            turn--;

                        } else {
                            System.out.println("Wordbox letters are: " + wordBox);
                            System.out.println("No!");
                            turn--;
                        }

                        if (turn == 0) {
                            hangman = true;
                        }

                        while (hangman == true) {
                            System.out.println("You lose!");
                            System.exit(0);
                        }

                    }
                    break;

                case 'C':
                    System.out.println("You have choosen Hard");
                    //Get and print random string from hardWords
                    int selectC = random.nextInt(hardWords1.length);
                    String replaceAllHard = hardWords1[selectC].replaceAll("\\S", "*");
                    // Print the randomly selected word and its length  
                    System.out.println("Random String selected: " + replaceAllHard);
                    System.out.println("This word contains " + hardWords1[selectC].length() + " letters");

                    //while hangman == false continue to ask player for letters
                    while (hangman == false) {
                        System.out.println("Turns remaining: " + turn);
                        System.out.println("Please choose a letter A-Z :");
                        String hardChosenLetter = scan.next();

                        if (wordBox.contains(hardChosenLetter)) {
                            System.out.println("Letter alreay choosen please choose another letter");
                        } else {
                            wordBox.add(hardChosenLetter);
                        }

                        wordBox.add(hardChosenLetter);
                        if (easyWords1[selectC].contains(hardChosenLetter)) {
                            System.out.println("Wordbox letters are: " + wordBox);
                            System.out.print("Yes!");
                            turn--;

                        } else {
                            System.out.println("Wordbox letters are: " + wordBox);
                            System.out.println("No!");
                            turn--;
                        }

                        if (turn == 0) {
                            hangman = true;
                        }

                        while (hangman == true) {
                            System.out.println("You lose!");
                            System.exit(0);
                        }


                    }
                    break;



            }

        }
    }
}
</code></pre>

<p>words class:</p>

<pre><code>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hangman;

import java.lang.reflect.Array;
import java.util.Random;

/**
 *
 * @author Adam2_000
 */
public class words extends Hangman {

    String[] easyWords = {"Bee", "Car", "Fish", "Shed"};
    String[] mediumWords = {"House", "Sheep", "Castle", "Phone"};
    String[] hardWords = {"Octagon", "Crocodile", "Chocolate", "Motorbike"};

    public String[] getEasyWords() {
        return easyWords;
    }

    public void setEasyWords(String[] easyWords) {
        this.easyWords = easyWords;
    }

    public String[] getMediumWords() {
        return mediumWords;
    }

    public void setMediumWords(String[] mediumWords) {
        this.mediumWords = mediumWords;
    }

    public String[] getHardWords() {
        return hardWords;
    }

    public void setHardWords(String[] hardWords) {
        this.hardWords = hardWords;
    }

    @Override
    public String toString() {
        return "words{" + "easyWords=" + easyWords + ", mediumWords=" + mediumWords + ", hardWords=" + hardWords + '}';
    }
}
</code></pre>
