public class hangPhrase { /* This program monitors a game of hangPhrase, which is sort of a merger of the games Hangman and Wheel of Fortune. A player enters a word or phrase and the second tries to guess it, one letter at a time. The program keeps track of the guesses and displays the letters in the phrase that have been located so far. The game is over when the second player guesses the phrase or makes 6 incorrect guesses. After each guess, the method "showGallows" inside the Gallows class is called to display a partially-hanged player, according to the number of wrong guesses that have been made so far: 1 = the head, 2 = the head and torso, 3 and 4 add an arm, and 5 and 6 add a leg. showGallows also displays in that window the partially-guessed phrase and the letters that the player has used so far. */ // Prompt the user to enter the next letter, checking that it // hasn't already been guessed; that is, it is not among the letters // already used. static char getNextGuess (String lettersUsed) { char ng = ' '; return ng; } static String updatePhrase(String pp, String sp, char nl) { // Return the String that results from replacing each character pp[i] // by nl for which nl == sp[i], for 0 <= i < sp.length(). That is, // all occurrences of '-' in pp that correspond to occurrences of nl // in sp are replaced by nl. String newpp = ""; return newpp; } // Obtain a secret phrase from the user and wipe it off the screen static String getSecretPhrase () { String sp; return sp; } public static void main(String[] args) { String lettersUsed, // the letters already guessed, e.g. "lex" secretPhrase, // the secret phrase, e.g, "hello there" partialPhrase; // the partially-guessed phrase, e.g. "-ell- --e-e" int wrongGuesses; // the number of wrong guesses, e.g. 1 char nextLetter; // next letter guessed, e.g. 'h' secretPhrase = getSecretPhrase(); partialPhrase = ""; Gallows g = new Gallows(300, 10); // open the gallows window // and show the state of the game for (int i=0; i