Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
Game represents a cowbull game.
type Guesser ¶
type Guesser interface { // Guess should return a guess number consisting of n digits. Guess(n int) (string, error) // Tell should tell the player the result of his guess. Tell(string, int, int) error }
Guesser represents a player that tries to guess a number.
type Thinker ¶
type Thinker interface { // Number makes the player to think of a number and returns the count of // its digits. Think() (int, error) // Try should return the cows and bulls in the specified number. // If the number's digit count is not equal to the one returned by Number, // the player should return (0, 0). Try(string) (cows int, bulls int, err error) }
Thinker represents a player that thinks of a number and answers questions about it.
Click to show internal directories.
Click to hide internal directories.