CSE 111 - Fall 2002
Lab #10 - Hangman
Background
For this lab, you will build the game hangman. Upon loading the page, the puzzle will be laid out on the screen. There should also be a way for the user to input their letter guesses, as well as a way to show the user what letters have already been guessed. When the user guesses a letter, if the letter is in the puzzle, the letter appears in the puzzle in the proper places. If the letter is not in the puzzle, the hangman begins to take shape. For each letter that is guessed, but does not appear in the puzzle, the hangman drawing keeps getting more complex. When the entire hangman is visible, the game is over and the user has lost. If the user gets all the letters in the puzzle before building the hangman, then the user has won.
For you implementation, the puzzle should remain the same each time you load the page. How many wrong guesses it takes for the user to lose is up to you and should be probably be based on how complex your puzzle is. You will need to make drawings for each stage of the hangman. How the user inputs their guess is up to you as well. The implementation below shows one possible ways, but there are other ways that may be easier/harder to implement.
Extra Credit
For additional credit, you can implement random puzzles, so that each time the page loads a different puzzle can be selected.
Sample Interaction
Below is a sample interaction that you may use as a guide for how to implement the game.