new GameForMachines()
- Implements:
- Game
Methods
-
<abstract> guess(history)
-
The abstract method that sub-classes must implement in order to generate guesses. For more information on the
responseobject in each turn's history, see Game#evaluateGuess.Parameters:
Name Type Description historyArray A history of the guesses so far:
[{ guess: [...], response: {...} }, ...]history[].guessArray An array of numbers representing the guess made in a particular turn.
history[].responseObject A response generated by
Game#evaluateGuess()to the guess made that turn.Returns:
An error! This method must be implemented by a sub-class.
- Type
- Error
-
play()
-
Plays the game using the class method
.guess()to generate guesses. Modifiesthis.historyto reflect the guesses (and responses) made during the game. Returns a boolean indicating victory.Returns:
Whether the strategy won the game (
true) or not (false).- Type
- Boolean