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
response
object in each turn's history, see Game#evaluateGuess.Parameters:
Name Type Description history
Array A history of the guesses so far:
[{ guess: [...], response: {...} }, ...]
history[].guess
Array An array of numbers representing the guess made in a particular turn.
history[].response
Object 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.history
to 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