games.jotto.players
Class ComputerGuesser
java.lang.Object
games.jotto.players.JottoGuesser
games.jotto.players.ComputerGuesser
- Direct Known Subclasses:
- RandomComputerGuesser, SmartComputerGuesser
public abstract class ComputerGuesser
- extends JottoGuesser
Field Summary |
protected java.lang.String |
myGuess
|
protected java.util.ArrayList<java.lang.String> |
myWordListCopy
|
Method Summary |
protected abstract void |
computerGuessesWord()
|
void |
newGame()
subclasses MUST implement the following three classes:
1) newGame
2) process
3) revealHint
4) revealAnswer |
void |
process(java.lang.String response)
Process input from the user. |
protected void |
tellModelWhosePlaying()
Designates whether human or computer is guessing to model so it can tell
Gui |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
myGuess
protected java.lang.String myGuess
myWordListCopy
protected java.util.ArrayList<java.lang.String> myWordListCopy
ComputerGuesser
public ComputerGuesser(int maxGuesses,
IJottoModel currentJottoGame,
java.util.ArrayList<java.lang.String> wordList)
computerGuessesWord
protected abstract void computerGuessesWord()
newGame
public void newGame()
- Description copied from class:
JottoGuesser
- subclasses MUST implement the following three classes:
1) newGame
2) process
3) revealHint
4) revealAnswer
- Specified by:
newGame
in class JottoGuesser
tellModelWhosePlaying
protected void tellModelWhosePlaying()
- Designates whether human or computer is guessing to model so it can tell
Gui
- Specified by:
tellModelWhosePlaying
in class JottoGuesser
process
public void process(java.lang.String response)
- Process input from the user. The input is a number of letters in common
with the user's secret word. This method does rudimentary analysis of
response for legality (number in range) and then calls abstract methods
implemented by a subclass.
- Specified by:
process
in class JottoGuesser
- Parameters:
response
- is the response from the user representing an int that's the
number of letters in common with last word guessed by
computer.