|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A class representing a "word in play", that is, the word which
is being guessed, along with status of which characters of it
have been
guessed (correctly or otherwise), etc.
Implementations should have a constructor that takes one
argument,
a string, and makes a hangman word out of it.
Field Summary | |
static char |
UNGUESSED_POSITION_MARKER
A character used to indicate unguessed positions of a word. |
Method Summary | |
java.lang.String |
getCurrentWordGuess()
Tells the word as a string, the same length and characters as the full correct correct answer, except that unguessed positions are marked as such with a special character (such as '_'). |
java.lang.String |
getWord()
Tells the word as a simple string; this is the "dictionary" form of the full word as the players think of it. |
boolean |
recordCharacterGuess(char c)
Takes note of the fact that another character has been guessed. |
int |
remainingUnguessedChars()
Tells how many character positions of the word are still unguessed. |
Field Detail |
public static final char UNGUESSED_POSITION_MARKER
Method Detail |
public java.lang.String getWord()
public java.lang.String getCurrentWordGuess()
public boolean recordCharacterGuess(char c)
c
- any character value (the character being guessed).
public int remainingUnguessedChars()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |