CS 110 Introduction to Computing
Fall 2003
Project #6: Word Game: Hangman
Due in class on Wednesday December 10, 2003
See below for notes on the deadline.
Write a Java program that plays the game of Hangman. Your program
should have the following:
- A graphical user interface
- The letters should be selected by creating buttons (see applet
below) which can be active or inactive depending on the state.
- The program should display graphically the status of "hangman".
See the blue/cyan pane in the applet below.
- The program should display the number of guesses as well
as the average number of guesses per word.
- Allow a maximum of 6-8 guesses per word (fix the number based on your creation
of the hangman graphic).
- A dictionary class conatining words will be provided at a
later date for use with your program. Its interface is discussed
below.
Here is an example applet (not yet complete) for your guidance.
Your applet should have similar functionality, but design the
GUI on your own, this is just a sample design.
Some useful pointers and hints: Go
to Implementation Notes/Schedule
- Hangman is a popular word game. Search on the internet to find out many
versions of it to get ideas for your applet.
- We will discuss the creation of the dictionary in class. For now assume
that there is a class defined as follows:
public class Dictionary {
public static final int nWords; // #of words contained in dictionary
public Dictionary() {
// creates a new dictionary of nWords
....
}
public String getWord() {
// returns a word from the dictionary
}
}
Notes for the exercise:
DEADLINE: You
will have to give a LIVE demonstration of your applet to the instructor.
Schedule a time between December 10 and December 12 4:00p with your instructor
for this. Hand in the printed project at the time of your demonstration. Hand
in the printed report (described below) in class on December 10.
Since this is the last project of the semester, NO EXTENSIONS OR LATE SUBMISSIONS
will be accepted.
- All work should be your own. You are only allowed to consult with the TA's
and the instrcutor. No one else, no exceptions.
- Play close attention to the syntax. Every Java instruction has to be written
with proper punctuations as well as with consistent use of upper/lower case
character combinations.
- Make sure you enter your name in the NAME slot
at the top of the program. Also, use the SIGNATURE
slot in your applet.
- Post the applet on your web page.
- Once you are done with the exercise, hand in a printed (stapled) report
that contains the following:
- A printout of your Java program
- A screen snapshot of your applet.
- A printout of your project window.
- A short essay on your experience in doing this assignment. We want to
know how it all worked out for you and how you feel about completing this
assignment.
Back to: CS110 Course Materials