|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dolben.MarkN.Generator
public abstract class Generator
This is the interface for an N digit number game guess generator. Derive a class from this one with a constructor and the methods given here to implement some algorithm for generating guesses.
A Guesser repeatedly calls nextGuess() to get the next guess and then tellScore() to give the Generator the score for the last guess.
Constructor Summary | |
---|---|
Generator()
|
Method Summary | |
---|---|
abstract boolean |
nextGuess(Numbah guess)
makes the next guess |
abstract void |
retractScore()
backs up the generator to the state before the last nextGuess() |
abstract void |
tellScore(Score score)
is told a score for the last guess |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Generator()
Method Detail |
---|
public abstract boolean nextGuess(Numbah guess)
guess
- the guess that gets generated, if possible
public abstract void tellScore(Score score)
score
- the score for the last guess -
the score must be legit, though may be inconsistent with previous scores
in which case nextGuess() will return falsepublic abstract void retractScore()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |