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.
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!
The Word class should have one member variable: an ArrayList of Characters, representing the word. It should contain the following methods:
The Hangman game will use two words (one for the secret word and one for the user guess), plus an ArrayList to keep track of previously guessed Characters.
The program is due, both electronically and as a hard copy, at class time of the due date. You must bring a hard-copy of all your source code to class, as well as a structure chart. You will be graded with interactive grading, as with the previous projects.
You must code all programs from scratch. It is OK for you to discuss solutions to this program with your classmates. However, no collaboration should ever involve looking at one of your classmate's source programs, or any other similar program of another student or from the Internet.
Up to 10 points, depending on style and sophistication.