|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dolben.MarkN.Generator
org.dolben.MarkX.BruteForceGenerator
class BruteForceGenerator
This class contains the N digit number game guess Generator that uses the Brute Force algorithm.
For each next guess it simply goes through a sequence of valid numbers to find one that could have given all of the scores that were obtained for the previous guesses.
Constructor Summary | |
---|---|
BruteForceGenerator()
constructs a BruteForceGenerator |
Method Summary | |
---|---|
static void |
main(java.lang.String[] arg)
tests the class |
boolean |
nextGuess(Numbah guess)
generates the next guess |
void |
retractScore()
backs up to state before last nextGuess() |
void |
tellScore(Score score)
is given 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 |
---|
BruteForceGenerator()
Method Detail |
---|
public boolean nextGuess(Numbah guess)
nextGuess
in class Generator
guess
- the next generated guess
public void tellScore(Score score)
tellScore
in class Generator
score
- the score for the last guesspublic void retractScore()
retractScore
in class Generator
public static void main(java.lang.String[] arg) throws java.lang.Exception
arg
- ignored
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |