Im suppose to write a code on if a player wants the instructions or not
it needs to say something like Welcome to the game of Hangman. Do you need instructions? (yes or no): and then you pick the answer if you want to see them or not but it didn't work..
I did this
CODE
String printInstructions;
//need a way of keeping track of how far on the hangman is
//ooooh, the length of the array list is the number of bad guesses they've made
System.out.print("Instructions: ");
printInstructions = in.next();
if(printInstructions == "yes")
{
System.out.print("The game of hangman is a popular fill-in-the-blank word guessing game between two players. The rules for the game are as follows: ");
System.out.println("The first player picks a word from an agreed-upon set of words, draws a blank space for each letter in the word, and draws an empty hangman's scaffold.");
System.out.println("The first player picks a word from an agreed-upon set of words, draws a blank space for each letter in the word, and draws an empty hangman's scaffold.");
System.out.println("The second player tries to determine what the word is by guessing letters which he thinks might be in the word.");
System.out.println("The first player checks each guess against the letters in the selected word.");
System.out.println("If the guess matches any letters in the actual word, the blank space for the letter is filled in for each occurrence of the guess in the word.");
System.out.println("If the guess does not match any letters in the actual word, a piece of the stick person is added to the drawing of the hangman's scaffold.");
System.out.println("If the second player completes the word before the drawing is completed, the second player is the winner.");
System.out.println("However, if the hangman is completed before the word is completed, the first player is the winner.");
}
else if(printInstructions == "no")
{
System.out.print("Type no to quit: ");
printInstructions = in.next();
}
}