|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--GuessingGame
Constructor Summary | |
GuessingGame()
Creates a new instance of the guessing game. |
|
GuessingGame(int max)
Creates a new instance of the guessing game. |
|
GuessingGame(int min,
int max)
Creates a new instance of the guessing game. |
Method Summary | |
boolean |
guessCorrect(int guess)
Checks to see if the player's choice matches the secret number |
boolean |
guessTooHigh(int guess)
Checks to see if the player's choice is higher than the secret number |
boolean |
guessTooLow(int guess)
Checks to see if the player's choice is lower than the secret number |
boolean |
inRange(int guess)
Checks to see if the player's guess greater than or equal to the minimum possible value and less than or equal to the maximum possible value |
java.lang.String |
toString()
Returns a String representation of this GuessingGame which gives the secret number |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public GuessingGame()
public GuessingGame(int max)
max
- The maximum number to be guessedpublic GuessingGame(int min, int max)
min
- The minimum possible number to be guessedmax
- The maximum possible number to be guessedMethod Detail |
public boolean guessCorrect(int guess)
guess
- The number guessed by the playerpublic boolean guessTooHigh(int guess)
guess
- The number guessed by the playerpublic boolean guessTooLow(int guess)
guess
- The number guessed by the playerpublic boolean inRange(int guess)
guess
- The number guessed by the playerpublic java.lang.String toString()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |