package peeveli
- Alphabetic
- Public
- Protected
Type Members
- class GameState extends AnyRef
Each instance of class
GameState
represents a single state within the Peeveli variant of Hangman: What does the (partially visible) target word look like to the guesser? How many incorrect guesses can the guesser still make? Which guesses have already been made? Moreover, our dishonest hangman needs an additional piece of information: Which words are still credible solutions given the earlier guesses?Each instance of class
GameState
represents a single state within the Peeveli variant of Hangman: What does the (partially visible) target word look like to the guesser? How many incorrect guesses can the guesser still make? Which guesses have already been made? Moreover, our dishonest hangman needs an additional piece of information: Which words are still credible solutions given the earlier guesses?Chapter 9.3 of the ebook has a detailed discussion of the internal logic of the Peeveli game.
While a player plays a game of Peeveli, the game will move from one state to another. Even so, each
GameState
object is immutable. Each successive state is represented by a newGameState
object, which is generated by calling the current state'sguessLetter
method.