CS 112

Project 3: Hangman

Assigned: Wednesday, October 26

Program Due: Wednesday November 16. (pt A due Friday November 4)


Implement the game of Hangman. You can find an example applet here .

The game is a one-player game. The user plays against the computer, who picks a secret word. The user then guesses letters thatmight appear in the word. If the guess is correct, those letters in the secret word are revealed. If the guess is incorrect, a body part is added to the hangman. The user continues until she gets the secret word, the hangman is complete (six wrong letters) or she quits.

You must build this using Eclipse, and using Jigloo to to build the GUI.

PART A: Due Friday, November 4.

First implement Hangman as a command-line program (no GUI). Your program should prompt the user for letters, and then print the portions of the secret word that have been revealed, and the number of guesses so far. If the user guesses a letter that's been guessed previously, your program should print a notification an re-prompt them (this doesn't count as an incorrect guess). It should display a message when they win or lose.

Implement the command-line version first, and show it to your instructor, before going on to Part B.

Part B: Due Monday, November 11. Provide a graphical user interface (GUI) for the game. Minimally, the interface must contain a textbox for entering user input, a text area displaying previously guessed letters, a panel showing the secret word (with blanks for unrevealed letters), a panel showing the hangman, and buttons to submit, quit and reset. This GUI should be implemented as an applet. Finally, you should put your applet up on a web page so that everyone can check out your game.

Extra Credit

Improve the GUI to make it more cool. For example, you could add sound, more more colors. You could allow users to log in, and keep track of how many games they've won. You could create a two-player version, in which one person gets to enter the secret word and t he other person guesses. Be creative!

Design Requirements (for all solutions!)